Bu skriptin köməyi ilə siz jpg,gif,png,bmp formatında olan şəkillərin üzərinə avtomatik olaraq istədiyiniz yazını yaza bilərsiniz.
<?php
list($width,$height, $type, $attr)=
getimagesize($imgfile);
$image_type=array('1','2','3','6');
if(array_search($type,$image_type)) {
switch($type){
case 1: $im = imagecreatefromgif($imgfile); break;
case 2: $im = imagecreatefromjpeg($imgfile); break;
case 3: $im = imagecreatefrompng($imgfile); break;
case 6: $im = imagecreatefromwbmp($imgfile); break;
}
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
$img_x = (imagesx($im) - 10.5 * strlen($string)) / 2;
$img_y = imagesy($im) - 20 ;
imagestring($im, 5, 10, $img_y, $text, $white);
switch($type){
case 1: $head = header("Content-type: image/gif");
$img = imagegif($im); break;
case 2: $head = header("Content-type: image/jpeg");
$img = imagejpeg($im); break;
case 3: $head = header("Content-type: image/png");
$img = imagepng($im); break;
case 6: $head = header("Content-type: image/bmp");
$img = imagewbmp($im); break;
}
return $head.$img;
}
}
imageText("sekil.png","systools.info");
?>
axırıncı dəyişikliklər (11.10.09 13:52)




Şərhər
RSS şərhlər bu posta uyğun olaraq.