Buyrun arkadaşlar sitemde kullandım bi ara, fakat çok band yedi.Resmi kaydetmeden direk üzerine yazıyo.Rengiyle ve yeriyle oynayabilirsiniz.Gd library'sini hostunuza söleyin yüklesin.
<?php
$text = 'Somurgen.NET';
$ext=substr($imgfile,-3);
$ext=strtolower($ext);
if($ext=="jpg" || $ext=="jpe" || $ext=="peg") $im=@imagecreatefromjpeg("$imgfile");
elseif ($ext=="gif") $im=@imagecreatefromgif("$imgfile");
else {print "Unknown image format"; exit;}
if (!$im) { /* See if it failed */
$im = imagecreate(150, 30); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
/* Output an errmsg */
imagestring($im, 1, 5, 5, "Error loading $imgfile", $tc);
return $im;
}
$x=imagesx($im);
$y=imagesy($im);
$fontsize=$x/20;
$fontsize=floor($fontsize);
if($fontsize<10) $fontsize=10;
$renk = imagecolorallocate($im, 255, 0, 0);
imagestring($im, $fontsize, 7, 7, $text, $renk);
if($ext=="gif")
{
header("Content-type: image/gif");
imagegif($im);
}
else
{
header("Content-type: image/jpeg");
imagejpeg($im);
}
imagedestroy($im);
?>kullanımı: /img.php?imgfile="resim yolu.jpg"