bueno, pasa ke kiero hacer firmas dinamicas para mi clan donde salgan sus estadisticas, el archivo es http://clancmc.uni.cc/firma.png , ya da el fondo XD
bueno, aki va el codigo:
pueden fijarse en http://www.clancmc.uni.cc/firma.png?m=zeus que da muchos errores xD
bueno, espero que puedan ayudarme...
salu2
bueno, aki va el codigo:
PHP:
<?php
$im = imagecreatefrompng("fondo.png");
$gris = imagecolorallocate($im, 128, 128, 128);
$fuente = 'adelain.ttf';
$nombre=$_GET['nombre'];
if($_GET['m']=="")
{
}
else
{
include('cm.php');
$res1=mysql_query("SELECT 'rango' FROM miembros WHERE nombre='$nombre'");
$res2=mysql_query("SELECT 'skills' FROM miembros WHERE nombre='$nombre'");
$res3=mysql_query("SELECT 'acesinatos' FROM miembros WHERE nombre='$nombre'");
if (file_exists("users/". $nombre. ".png"))
{
$foto="users/". $nombre. ".png";
}
}
$texto1=$res1;
$texto2=$res2;
$texto3=$res3;
$texto4=$res4;
$size = getimagesize("fondo.png");
// png-24
$im_tc = imagecreatetruecolor($size[0],$size[1]);
imagecopy($im_tc,$im,0,0,0,0,$size[0],$size[1]);
//crea los textos
imagettftext($im, 20, 0, 10, 20, $gris, $fuente, $texto1);
imagettftext($im, 20, 0, 10, 20, $gris, $fuente, $texto2);
imagettftext($im, 20, 0, 10, 20, $gris, $fuente, $texto3);
imagettftext($im, 20, 0, 10, 20, $gris, $fuente, $texto4);
imagettftext($im, 20, 0, 10, 20, $gris, $fuente, $nombre);
imagedestroy($im);
//de vuelta a png 8
$im_result = imagecreate($size[0],$size[1]);
imagecopy($im_result,$im_tc,0,0,0,0,$size[0],$size[1]);
imagedestroy($im_tc);
//imprime la imagen
header("Content-type: image/jpeg");
ImagePng($im_result);
ImageDestroy($im);
?>
pueden fijarse en http://www.clancmc.uni.cc/firma.png?m=zeus que da muchos errores xD
Warning: imagettftext() expects parameter 8 to be string, resource given in /home/jptosso/public_html/clancmc.uni.cc/firma.png on line 31
Warning: imagettftext() expects parameter 8 to be string, resource given in /home/jptosso/public_html/clancmc.uni.cc/firma.png on line 32
Warning: imagettftext() expects parameter 8 to be string, resource given in /home/jptosso/public_html/clancmc.uni.cc/firma.png on line 33
Warning: Cannot modify header information - headers already sent by (output started at /home/jptosso/public_html/clancmc.uni.cc/firma.png:31) in /home/jptosso/public_html/clancmc.uni.cc/firma.png on line 46
bueno, espero que puedan ayudarme...
salu2
Last edited: