Criar etiquetas de endereçamento com FastReport3
1)
Criar Etiqueta no Fast Report
Colocar ReportTitle
MasterData
Shape: skRoundRectangle
Coloque os dados para gerar a etiqueta ( nome, endereco,bairro)
Se quiser usar pronomes de tratamento é só colocar um [Edit1.Text] e depois associa-los.
Frame Color : clSilver
Em Columns coloque := 2
ColumnWidth:= 9,50
ParentFont:= False
2)
Criar um Dialog Page com pronomes de tratamento
Click em DialogPage
Coloque o radiobutton
Em caption coloque as atribuições
Coloque um button
3)
Depois em code faça as associações:
procedure RadioButton1OnClick(Sender: TfrxComponent);
begin
if (RadioButton1.Checked)then
Memo14.Text:= 'Sr.º';
end;
procedure RadioButton2OnClick(Sender: TfrxComponent);
begin
if (RadioButton2.Checked)then
Memo14.Text:= 'Sr.ª';
end;
procedure RadioButton3OnClick(Sender: TfrxComponent);
begin
if (RadioButton3.Checked)then
Memo14.Text:= 'V.S.ª';
end;
quarta-feira, 21 de novembro de 2012
quinta-feira, 8 de novembro de 2012
PrettyPhoto pegando imagens no Mysql
<html>
<head>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" charset="utf-8" />
</head>
<?php
$tamanhoPagina = 13;
$numLinks = 1;
$page = (int) $_GET['page'];
if (!$page) {
$inicio = 0;
$page=1;
}
else {
$inicio = ($page - 1) * $tamanhoPagina;
}
$sql = "select date_format(data,'%d/%m/%y')as data,numero,evento,linkimagem,link from dallas order by numero desc";
$query1=mysql_query($sql);
$total=mysql_num_rows($query1);
$numRegistros = $total;
$total_paginas = ceil($numRegistros / $tamanhoPagina);
$limit = " $inicio, $tamanhoPagina";
if($total>0){
$sql .= " limit ".$limit;
$query=mysql_query($sql);
//include('');
$fabrica = new fabrica();
$P = $fabrica->load_lib("paginator", "");
$P->totalRegistros = $numRegistros;
$P->limit = $tamanhoPagina;
$P->urlBusca = "secao=eventos";
?>
<table cellpadding="1" cellspacing="1" class="tahoma11azulb" style="width:530px;border:solid 1px #fff;">
<tr style="background-color:#079dcf">
<td height="5" class="tahoma11brancob"><div align="center">Data</div></td>
<td class="tahoma11brancob"><div align="center">Número</div></td>
<td class="tahoma11brancob"><div align="center">Miniatura</div></td>
<td class="tahoma11brancob"><div align="center">Eventos</div></td>
</tr>
<?
$i=0;
while($linha=mysql_fetch_array($query)){
?>
<tr style="border:1px solid red;background-color:<?=($i==1 or $i%2)?"#ecf6fc;":"#fff"?>">
<td valign="top"><p style="text-align:center"><?=utf8_encode($linha['data']);?></p></td>
<td valign="top"><p style="text-align:center"><?=$linha['numero']?></p></td>
<td valign="top"><p style="align:center"><img src=<?=$linha['linkimagem']?>></img></p></td>
<td valign="top"><p style="text-align:center"><?=($linha['evento']);?><br>
<?
$imgc = 1;
$images=glob(".$linha[link]{*.jpg,*.png,*.gif,*.bmp}", GLOB_BRACE);
echo "Fotos ";
foreach($images as $image) { ?><a href="<?=$image;?>" rel="prettyPhoto[galeria_<? echo $i; ?>]"><? echo $imgc . " | "; $imgc++; ?></a><? } ?>
</p></td>
</tr>
<tr style="border-bottom:10px solid; background-color:<?=($i== 1 or $i % 2)?"#ecf6fc;":"#fff"?>">
<td valign="top" style="font-weight:normal;" colspan="4"><p style="margin:6px;"><?=($linha['html'])?></p></td>
</tr>
<tr style="margin:0px;padding:0px;background:#079dcf;">
<td colspan="4" height="0px"></td>
</tr>
<?
$i++;
}
?>
</table>
<?php
if($total_paginas>1){ $P->show();}
}
else{
echo NaoExiste('Ainda não existem históricos cadastrados!','img/naoexiste.png','100');
}
?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<div style="clear:left"></div>
</html>
<head>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" charset="utf-8" />
</head>
<?php
$tamanhoPagina = 13;
$numLinks = 1;
$page = (int) $_GET['page'];
if (!$page) {
$inicio = 0;
$page=1;
}
else {
$inicio = ($page - 1) * $tamanhoPagina;
}
$sql = "select date_format(data,'%d/%m/%y')as data,numero,evento,linkimagem,link from dallas order by numero desc";
$query1=mysql_query($sql);
$total=mysql_num_rows($query1);
$numRegistros = $total;
$total_paginas = ceil($numRegistros / $tamanhoPagina);
$limit = " $inicio, $tamanhoPagina";
if($total>0){
$sql .= " limit ".$limit;
$query=mysql_query($sql);
//include('');
$fabrica = new fabrica();
$P = $fabrica->load_lib("paginator", "");
$P->totalRegistros = $numRegistros;
$P->limit = $tamanhoPagina;
$P->urlBusca = "secao=eventos";
?>
<table cellpadding="1" cellspacing="1" class="tahoma11azulb" style="width:530px;border:solid 1px #fff;">
<tr style="background-color:#079dcf">
<td height="5" class="tahoma11brancob"><div align="center">Data</div></td>
<td class="tahoma11brancob"><div align="center">Número</div></td>
<td class="tahoma11brancob"><div align="center">Miniatura</div></td>
<td class="tahoma11brancob"><div align="center">Eventos</div></td>
</tr>
<?
$i=0;
while($linha=mysql_fetch_array($query)){
?>
<tr style="border:1px solid red;background-color:<?=($i==1 or $i%2)?"#ecf6fc;":"#fff"?>">
<td valign="top"><p style="text-align:center"><?=utf8_encode($linha['data']);?></p></td>
<td valign="top"><p style="text-align:center"><?=$linha['numero']?></p></td>
<td valign="top"><p style="align:center"><img src=<?=$linha['linkimagem']?>></img></p></td>
<td valign="top"><p style="text-align:center"><?=($linha['evento']);?><br>
<?
$imgc = 1;
$images=glob(".$linha[link]{*.jpg,*.png,*.gif,*.bmp}", GLOB_BRACE);
echo "Fotos ";
foreach($images as $image) { ?><a href="<?=$image;?>" rel="prettyPhoto[galeria_<? echo $i; ?>]"><? echo $imgc . " | "; $imgc++; ?></a><? } ?>
</p></td>
</tr>
<tr style="border-bottom:10px solid; background-color:<?=($i== 1 or $i % 2)?"#ecf6fc;":"#fff"?>">
<td valign="top" style="font-weight:normal;" colspan="4"><p style="margin:6px;"><?=($linha['html'])?></p></td>
</tr>
<tr style="margin:0px;padding:0px;background:#079dcf;">
<td colspan="4" height="0px"></td>
</tr>
<?
$i++;
}
?>
</table>
<?php
if($total_paginas>1){ $P->show();}
}
else{
echo NaoExiste('Ainda não existem históricos cadastrados!','img/naoexiste.png','100');
}
?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<div style="clear:left"></div>
</html>
quinta-feira, 1 de novembro de 2012
Marcando Coordenadas no Mapa com area shape poly
Olá Gente estava com um grande problema em <? php
Era o seguinte tinha um mapa e querias saber as coordenadas dele, depois de quebrar a cabeça achei um código de um colega na internet que ensinava.
http://blogdofabiolima.blogspot.com/2009/01/mapeamento-de-imagens-em-html.html
Segue o código e o mapa;
<html>
<head>
<script type="text/javascript">
function coordenadas(event)
{
var x=event.clientX;
var y=event.clientY;
var coord = x + "," + y;
return coord;
}
function listar(event){
var coord = coordenadas(event);
var texto = document.getElementById("listacoord");
texto.value += coord + ",";
}
</script>
</head>
<body>
<!-- AQUI VOCE COLOCA O ENDERECO DA IMAGEM QUE QUER MAPEAR -->
<!-- SUBSTITUA "IMAGEM.JPG" PELA SUA IMAGEM -->
<div align="center">
<img src="mapa_brasil.jpg" width="390" height="369" border="0" usemap="#Map3"style="border-style:none;position:absolute;top:0px;left:0px" onmousedown="listar(event)">
</div>
<p style="position:absolute;top:400px;">Clique na imagem para marcar as coordenadas.<br/>
Copie estas coordenadas e cole dentro no atributo coords="" da tag <AREA>.<br/>
Não esqueça de apagar a vírgula no final do da linha gerada.</p>
<textarea type="text" style="position:relative;top:500px;" id="listacoord" cols="100" rows="8"></textarea>
</body>
</html>
Depois surgiu um outro problema, como pegar as informações no banco de dados e colocar em cada estado correspondente?
Segue o código....
<html>
<body>
<div id="contents">
<div id="main">
<?
$sql="select * from homologacaobrasil";
$query=mysql_query($sql);
$total=mysql_num_rows($query);
?>
<div id="tit_pagina">
<p class="tahoma14azulb" style="margin-left:15px">Homologações</p>
</div>
<div id="corpo_pagina">
<div id="texto" class="tahoma11preto" align="justify">
<p><span class="tahoma11preto">Disponibilizamos aqui as homologações dos módulos separado por estado.</span></p>
</div><br />
<div align="center">
<img src="img/estados-homologados.jpg" style="position:relative;border-style:none;" width="400" height="352" usemap="#Map3"/>
</div>
<map name="Map3">
<?
$i=0;
while($linha=mysql_fetch_array($query)){
?>
<? if ($linha['recno']=='1'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="267,157,308,157,309,173,266,169" title="Bahia" alt="Ba" />
<? } ?>
<? if ($linha['recno']=='2'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="152,216,186,218,186,252,152,252" title="Mato Grosso do Sul" alt="MS" />
<? } ?>
<? if ($linha['recno']=='3'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="81,14,130,15,130,27,79,24" title="Roraima" alt="RR"/>
<? } ?>
<? if ($linha['recno']=='4'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="49,91,128,91,125,100,53,99" title="Amazonas" alt="AM" />
<? } ?>
<? if ($linha['recno']=='5'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="201,201,224,202,225,209,199,209" title="Goias" alt="GO" />
<? } ?>
<? if ($linha['recno']=='6'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="13,135,44,136,44,145,11,145" title="Acre" alt="AC" />
<? } ?>
<? if ($linha['recno']=='7'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="331,139,367,140,332,145,365,144" title="Alagoas" alt="AL" />
<? } ?>
<? if ($linha['recno']=='8'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="312,83,335,94,335,102,325,124,312,106" title="Ceará" alt="CE" />
<? } ?>
<? if ($linha['recno']=='9'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="232,193,237,194,232,196,238,196" title="Distrito Federal" alt="DF" />
<? } ?>
<? if ($linha['recno']=='10'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="297,229,356,227,295,232,359,237" title="Espirito Santo" alt="ES" />
<? } ?>
<? if ($linha['recno']=='11'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords= "259,65,241,100,258,142,284,109,288,74" title="Maranhao"alt="MA">
<? } ?>
<? if ($linha['recno']=='12'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="248,214,276,214,248,220,276,220" title="Minas Gerais" alt="MG">
<? } ?>
<? if ($linha['recno']=='13'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="166,87,208,88,208,105,161,103" title="Para" alt="PA">
<? } ?>
<? if ($linha['recno']=='14'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="337,114,366,115,338,119,363,119" title="Paraiba" alt="PB">
<? } ?>
<? if ($linha['recno']=='15'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="328,128,389,128,326,132,389,133" title="Pernambuco" alt="PE">
<? } ?>
<? if ($linha['recno']=='16'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="334,95,359,96,328,102,362,104" title="Rio Grande do Norte" alt="RN">
<? } ?>
<? if ($linha['recno']=='17'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="170,215,155,219,155,255,182,272,202,244,202,228,186,216" title="Rio Grande do Sul" alt="RS">
<? } ?>
<? if ($linha['recno']=='18'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="136,225,135,227,148,229,162,240,167,233,166,219,151,224,134,224" title="Santa Catarina" alt="SC">
<? } ?>
<? if ($linha['recno']=='19'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="206,239,233,244,211,259,234,272" title="Sao Paulo" alt="SP">
<? } ?>
<? if ($linha['recno']=='20'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="329,152,358,151,327,154,358,154" title="Sergipe" alt="SE">
<? } ?>
<?
$i++;
}
?>
</map>
</div></div>
</html>
Era o seguinte tinha um mapa e querias saber as coordenadas dele, depois de quebrar a cabeça achei um código de um colega na internet que ensinava.
http://blogdofabiolima.blogspot.com/2009/01/mapeamento-de-imagens-em-html.html
Segue o código e o mapa;
<html>
<head>
<script type="text/javascript">
function coordenadas(event)
{
var x=event.clientX;
var y=event.clientY;
var coord = x + "," + y;
return coord;
}
function listar(event){
var coord = coordenadas(event);
var texto = document.getElementById("listacoord");
texto.value += coord + ",";
}
</script>
</head>
<body>
<!-- AQUI VOCE COLOCA O ENDERECO DA IMAGEM QUE QUER MAPEAR -->
<!-- SUBSTITUA "IMAGEM.JPG" PELA SUA IMAGEM -->
<div align="center">
<img src="mapa_brasil.jpg" width="390" height="369" border="0" usemap="#Map3"style="border-style:none;position:absolute;top:0px;left:0px" onmousedown="listar(event)">
</div>
<p style="position:absolute;top:400px;">Clique na imagem para marcar as coordenadas.<br/>
Copie estas coordenadas e cole dentro no atributo coords="" da tag <AREA>.<br/>
Não esqueça de apagar a vírgula no final do da linha gerada.</p>
<textarea type="text" style="position:relative;top:500px;" id="listacoord" cols="100" rows="8"></textarea>
</body>
</html>
Depois surgiu um outro problema, como pegar as informações no banco de dados e colocar em cada estado correspondente?
Segue o código....
<html>
<body>
<div id="contents">
<div id="main">
<?
$sql="select * from homologacaobrasil";
$query=mysql_query($sql);
$total=mysql_num_rows($query);
?>
<div id="tit_pagina">
<p class="tahoma14azulb" style="margin-left:15px">Homologações</p>
</div>
<div id="corpo_pagina">
<div id="texto" class="tahoma11preto" align="justify">
<p><span class="tahoma11preto">Disponibilizamos aqui as homologações dos módulos separado por estado.</span></p>
</div><br />
<div align="center">
<img src="img/estados-homologados.jpg" style="position:relative;border-style:none;" width="400" height="352" usemap="#Map3"/>
</div>
<map name="Map3">
<?
$i=0;
while($linha=mysql_fetch_array($query)){
?>
<? if ($linha['recno']=='1'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="267,157,308,157,309,173,266,169" title="Bahia" alt="Ba" />
<? } ?>
<? if ($linha['recno']=='2'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="152,216,186,218,186,252,152,252" title="Mato Grosso do Sul" alt="MS" />
<? } ?>
<? if ($linha['recno']=='3'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="81,14,130,15,130,27,79,24" title="Roraima" alt="RR"/>
<? } ?>
<? if ($linha['recno']=='4'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="49,91,128,91,125,100,53,99" title="Amazonas" alt="AM" />
<? } ?>
<? if ($linha['recno']=='5'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="201,201,224,202,225,209,199,209" title="Goias" alt="GO" />
<? } ?>
<? if ($linha['recno']=='6'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="13,135,44,136,44,145,11,145" title="Acre" alt="AC" />
<? } ?>
<? if ($linha['recno']=='7'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="331,139,367,140,332,145,365,144" title="Alagoas" alt="AL" />
<? } ?>
<? if ($linha['recno']=='8'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="312,83,335,94,335,102,325,124,312,106" title="Ceará" alt="CE" />
<? } ?>
<? if ($linha['recno']=='9'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="232,193,237,194,232,196,238,196" title="Distrito Federal" alt="DF" />
<? } ?>
<? if ($linha['recno']=='10'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="297,229,356,227,295,232,359,237" title="Espirito Santo" alt="ES" />
<? } ?>
<? if ($linha['recno']=='11'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords= "259,65,241,100,258,142,284,109,288,74" title="Maranhao"alt="MA">
<? } ?>
<? if ($linha['recno']=='12'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="248,214,276,214,248,220,276,220" title="Minas Gerais" alt="MG">
<? } ?>
<? if ($linha['recno']=='13'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="166,87,208,88,208,105,161,103" title="Para" alt="PA">
<? } ?>
<? if ($linha['recno']=='14'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="337,114,366,115,338,119,363,119" title="Paraiba" alt="PB">
<? } ?>
<? if ($linha['recno']=='15'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="328,128,389,128,326,132,389,133" title="Pernambuco" alt="PE">
<? } ?>
<? if ($linha['recno']=='16'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="334,95,359,96,328,102,362,104" title="Rio Grande do Norte" alt="RN">
<? } ?>
<? if ($linha['recno']=='17'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="170,215,155,219,155,255,182,272,202,244,202,228,186,216" title="Rio Grande do Sul" alt="RS">
<? } ?>
<? if ($linha['recno']=='18'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="136,225,135,227,148,229,162,240,167,233,166,219,151,224,134,224" title="Santa Catarina" alt="SC">
<? } ?>
<? if ($linha['recno']=='19'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="206,239,233,244,211,259,234,272" title="Sao Paulo" alt="SP">
<? } ?>
<? if ($linha['recno']=='20'){ ?> <area shape="poly" href="javascript:alert('<?php echo addslashes($linha['estado'] ." [". $linha['descricao']. "]"); ?>')" coords="329,152,358,151,327,154,358,154" title="Sergipe" alt="SE">
<? } ?>
<?
$i++;
}
?>
</map>
</div></div>
</html>
quinta-feira, 23 de agosto de 2012
Erro FastReport frxGradient
{******************************************}
{ }
{ FastReport v3.0 }
{ Gradient object }
{ }
{ (former RoundRect plus Add-in object) }
{ (C) Guilbaud Olivier for FR 2.4 }
{ mailto:golivier@free.fr }
{ }
{ Copyright (c) 1998-2005 }
{ by Alexander Tzyganenko, }
{ Fast Reports Inc. }
{ Fonte : http://www.codeforge.com/read/193769/frxGradient.pas__html
{ Obs: Cria uma unit e cola isso, será resolvido}
{******************************************}
unit frxGradient;
interface
{$I frx.inc}
uses
Windows, Messages, SysUtils, Classes, Graphics, frxClass
{$IFDEF Delphi6}
, Variants
{$ENDIF};
type
TfrxGradientObject = class(TComponent); // fake component
TfrxGradientStyle = (gsHorizontal, gsVertical, gsElliptic, gsRectangle,
gsVertCenter, gsHorizCenter);
TfrxGradientView = class(TfrxView)
private
FBeginColor:TColor;
FEndColor:TColor;
FStyle:TfrxGradientStyle;
procedure DrawGradient(X, Y, X1, Y1:Integer);
public
constructor Create(AOwner:TComponent); override;
procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
class function GetDescription:String; override;
published
property BeginColor:TColor read FBeginColor write FBeginColor default clWhite;
property EndColor:TColor read FEndColor write FEndColor default clGray;
property Style:TfrxGradientStyle read FStyle write FStyle;
property Frame;
end;
implementation
uses frxGradientRTTI, frxDsgnIntf, frxRes;
constructor TfrxGradientView.Create(AOwner:TComponent);
begin
inherited;
FBeginColor:= clWhite;
FEndColor:= clGray;
end;
class function TfrxGradientView.GetDescription:String;
begin
Result:= frxResources.Get('obGrad');
end;
procedure TfrxGradientView.DrawGradient(X, Y, X1, Y1:Integer);
var
FromR, FromG, FromB:Integer;
DiffR, DiffG, DiffB:Integer;
ox, oy, dx, dy:Integer;
procedure DoHorizontal(fr, fg, fb, dr, dg, db:Integer);
var
ColorRect:TRect;
I:Integer;
R, G, B:Byte;
begin
ColorRect.Top:= oy;
ColorRect.Bottom:= oy+dy;
for I:= 0 to 255 do
begin
ColorRect.Left:= MulDiv (I, dx, 256)+ox;
ColorRect.Right:= MulDiv (I+1, dx, 256)+ox;
R:= fr+MulDiv(I, dr, 255);
G:= fg+MulDiv(I, dg, 255);
B:= fb+MulDiv(I, db, 255);
FCanvas.Brush.Color:= RGB(R, G, B);
FCanvas.FillRect(ColorRect);
end;
end;
procedure DoVertical(fr, fg, fb, dr, dg, db:Integer);
var
ColorRect:TRect;
I:Integer;
R, G, B:Byte;
begin
ColorRect.Left:= ox;
ColorRect.Right:= ox+dx;
for I:= 0 to 255 do
begin
ColorRect.Top:= MulDiv (I, dy, 256)+oy;
ColorRect.Bottom:= MulDiv (I+1, dy, 256)+oy;
R:= fr+MulDiv(I, dr, 255);
G:= fg+MulDiv(I, dg, 255);
B:= fb+MulDiv(I, db, 255);
FCanvas.Brush.Color:= RGB(R, G, B);
FCanvas.FillRect(ColorRect);
end;
end;
procedure DoElliptic(fr, fg, fb, dr, dg, db:Integer);
var
I:Integer;
R, G, B:Byte;
Pw, Ph:Double;
x1, y1, x2, y2:Double;
bmp:TBitmap;
begin
bmp:= TBitmap.Create;
bmp.Width:= dx;
bmp.Height:= dy;
bmp.Canvas.Pen.Style:= psClear;
x1:= 0-(dx / 4);
x2:= dx+(dx / 4);
y1:= 0-(dy / 4);
y2:= dy+(dy / 4);
Pw:= ((dx / 4)+(dx / 2)) / 155;
Ph:= ((dy / 4)+(dy / 2)) / 155;
for I:= 0 to 155 do
begin
x1:= x1+Pw;
x2:= X2-Pw;
y1:= y1+Ph;
y2:= y2-Ph;
R:= fr+MulDiv(I, dr, 155);
G:= fg+MulDiv(I, dg, 155);
B:= fb+MulDiv(I, db, 155);
bmp.Canvas.Brush.Color:= R or (G shl 8) or (b shl 16);
bmp.Canvas.Ellipse(Trunc(x1), Trunc(y1), Trunc(x2), Trunc(y2));
end;
FCanvas.Draw(ox, oy, bmp);
bmp.Free;
end;
procedure DoRectangle(fr, fg, fb, dr, dg, db:Integer);
var
I:Integer;
R, G, B:Byte;
Pw, Ph:Real;
x1, y1, x2, y2:Double;
begin
FCanvas.Pen.Style:= psClear;
FCanvas.Pen.Mode:= pmCopy;
x1:= 0+ox;
x2:= ox+dx;
y1:= 0+oy;
y2:= oy+dy;
Pw:= (dx / 2) / 255;
Ph:= (dy / 2) / 255;
for I:= 0 to 255 do
begin
x1:= x1+Pw;
x2:= X2-Pw;
y1:= y1+Ph;
y2:= y2-Ph;
R:= fr+MulDiv(I, dr, 255);
G:= fg+MulDiv(I, dg, 255);
B:= fb+MulDiv(I, db, 255);
FCanvas.Brush.Color:= RGB(R, G, B);
FCanvas.FillRect(Rect(Trunc(x1), Trunc(y1), Trunc(x2), Trunc(y2)));
end;
FCanvas.Pen.Style:= psSolid;
end;
procedure DoVertCenter(fr, fg, fb, dr, dg, db:Integer);
var
ColorRect:TRect;
I:Integer;
R, G, B:Byte;
Haf:Integer;
begin
Haf:= dy Div 2;
ColorRect.Left:= 0+ox;
ColorRect.Right:= ox+dx;
for I:= 0 to Haf do
begin
ColorRect.Top:= MulDiv(I, Haf, Haf)+oy;
ColorRect.Bottom:= MulDiv(I+1, Haf, Haf)+oy;
R:= fr+MulDiv(I, dr, Haf);
G:= fg+MulDiv(I, dg, Haf);
B:= fb+MulDiv(I, db, Haf);
FCanvas.Brush.Color:= RGB(R, G, B);
FCanvas.FillRect(ColorRect);
ColorRect.Top:= dy-(MulDiv (I, Haf, Haf))+oy;
ColorRect.Bottom:= dy-(MulDiv (I+1, Haf, Haf))+oy;
FCanvas.FillRect(ColorRect);
end;
end;
procedure DoHorizCenter(fr, fg, fb, dr, dg, db:Integer);
var
ColorRect:TRect;
I:Integer;
R, G, B:Byte;
Haf:Integer;
begin
Haf:= dx Div 2;
ColorRect.Top:= 0+oy;
ColorRect.Bottom:= oy+dy;
for I:= 0 to Haf do
begin
ColorRect.Left:= MulDiv(I, Haf, Haf)+ox;
ColorRect.Right:= MulDiv(I+1, Haf, Haf)+ox;
R:= fr+MulDiv(I, dr, Haf);
G:= fg+MulDiv(I, dg, Haf);
B:= fb+MulDiv(I, db, Haf);
FCanvas.Brush.Color:= RGB(R, G, B);
FCanvas.FillRect(ColorRect);
ColorRect.Left:= dx-(MulDiv (I, Haf, Haf))+ox;
ColorRect.Right:= dx-(MulDiv (I+1, Haf, Haf))+ox;
FCanvas.FillRect(ColorRect);
end;
end;
begin
ox:= X;
oy:= Y;
dx:= X1-X;
dy:= Y1-Y;
FromR:= FBeginColor and $000000ff;
FromG:= (FBeginColor shr 8) and $000000ff;
FromB:= (FBeginColor shr 16) and $000000ff;
DiffR:= (FEndColor and $000000ff)-FromR;
DiffG:= ((FEndColor shr 8) and $000000ff)-FromG;
DiffB:= ((FEndColor shr 16) and $000000ff)-FromB;
case FStyle of
gsHorizontal:
DoHorizontal(FromR, FromG, FromB, DiffR, DiffG, DiffB);
gsVertical:
DoVertical(FromR, FromG, FromB, DiffR, DiffG, DiffB);
gsElliptic:
DoElliptic(FromR, FromG, FromB, DiffR, DiffG, DiffB);
gsRectangle:
DoRectangle(FromR, FromG, FromB, DiffR, DiffG, DiffB);
gsVertCenter:
DoVertCenter(FromR, FromG, FromB, DiffR, DiffG, DiffB);
gsHorizCenter:
DoHorizCenter(FromR, FromG, FromB, DiffR, DiffG, DiffB);
end;
end;
procedure TfrxGradientView.Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX,
OffsetY:Extended);
begin
BeginDraw(Canvas, ScaleX, ScaleY, OffsetX, OffsetY);
DrawGradient(FX, FY, FX1, FY1);
DrawFrame;
end;
initialization
frxObjects.RegisterObject1(TfrxGradientView, nil, '', 'Other', 0, 50);
end.
sábado, 11 de agosto de 2012
Erro no Ubuntu : sudo: can't open /etc/sudoers: Permissão negada
Para quem está com problemas no ubuntu de permissões basta executar o seguinte comando :
pkexec chmod 755 / etc
Coloca sua senha e pronto.
Fonte : http://askubuntu.com/questions/115358/changed-etc-permission-in-oneiric-ubuntu11-10-by-using-sudo-chmod-665-etc
pkexec chmod 755 / etc
Coloca sua senha e pronto.
Fonte : http://askubuntu.com/questions/115358/changed-etc-permission-in-oneiric-ubuntu11-10-by-using-sudo-chmod-665-etc
domingo, 29 de abril de 2012
terça-feira, 20 de março de 2012
Sou Analista de Sistemas
Bom turma, se você é Analista de Sistemas, ou trabalha na área, sabe que o mercado de trabalho está cada vez mais competitivo.
Se você fez área de informática pensando que ficaria rico em pouco tempo.... Se enganou... kakaka...
Na verdade para ser um bom Analista de Sistema, Programador, Analista de Suporte...
Sabe-se que tem que ralar muito, depois que termina a graduação.
Se você achou que estudou muito no período de 04(quatro) anos...Passe o resto da sua vida estudando, se você escolheu a área de TI é submissão, é gostar de tecnologia, e está sempre conectado, sintonizado com o mundo de TI, pois este muda enquanto dormimos ou tiramos um cochilo...
O analista de sistema tem por obrigação em estudar novos conceitos que envolve a área de TI, desde governança a linguagem de programação pois o analista é o cara que vai muitas vezes ao cliente para tentar descobrir o que realmente ele quer... É ele que faz o levantamento de requisitos, escreve o diagrama de caso de uso, modelagem, participa de projetos, analisa dados, etc.
Se você é programador... bom, ótimo seja especialista na sua linguagem de programação em que você gosta que você domine, e outra se poder tire certificação, mais aprenda outra linguagem, não fique preso em uma única, lógica é essencial pois o conceito de um bom programador é a logica.
Um bom vídeo para você analisar é do celebre Luca Bastos http://vimeo.com/6631342
Se pensou em Analista de Suporte... faça certificação COBIT, ITIL. isso será um diferencial para você.
Digo que não é fácil, mais fazer o que gosta é gratificante, o bom é entrou na faculdade, corra faça estágio em varias áreas, aproveite para aprender com professores, estude bastante, não seja um nerd, seja um curioso.
Pois TI é criatividade, curiosidade, dinamismo, força, coragem.
Sempre esteja aberto em aprender, seja observador e outra não tenha medo de errar, porém seja simples, humilde.
Abraços.
Assinar:
Postagens (Atom)






