رائع التعاون ما شاء الله ....... بس والله كنت متمني عدد أكبر من الردود ..
المهم ، تعديلي عالكود :
كود PHP:
<?
// القيمة 1 للبارامتر type تجعل النص بوضع أفقي أما القيمة 2 تجعله عمودي
// تغيير قيمة البارامتر textposition سيغير من مكان ظهور الكتابة على الصورة
function MakeImage($fileurl,$text,$destinationfile,$texttype=1,$textposition=1,$fontsize=5) {
header("Content-type: image/jpg");
$parts = explode(".",$fileurl);
$e = $parts[count($parts)-1];
$image = ImageCreateFromJPEG($fileurl);
$is2 = getImageSize($fileurl);
$is3[0] = $is2[0] - $is[0];
$is3[1] = $is2[1] - $is[1];
$half[0] = $is[0] / 2;
$half[1] = $is[1] / 2;
$c[0] = $is2[0] / 2 - $half[0];
$c[1] = $is2[1] / 2 - $half[1];
if ($texttype=="1") {
if ($textposition=="1") { $xx = "10"; $yy = "10"; }
elseif ($textposition=="2") { $xx = $is2[0]-(9*strlen($text)); $yy = "0"; }
elseif ($textposition=="3") { $xx = "10"; $yy = $is2[1]-20; }
elseif ($textposition=="4") { $xx = $is2[0]-(9*strlen($text)); $yy = $is2[1]-20; }
elseif ($textposition=="5") { $xx = ($is2[0]-(9*strlen($text)))/2; $yy = "10"; }
elseif ($textposition=="6") { $xx = "10"; $yy = ($is2[1]-20)/2; }
elseif ($textposition=="7") { $xx = $is2[0]-(9*strlen($text)); $yy = ($is2[1]-20)/2; }
elseif ($textposition=="8") { $xx = ($is2[0]-(9*strlen($text)))/2; $yy = ($is2[1]-20)/2; }
elseif ($textposition=="9") { $xx = ($is2[0]-(9*strlen($text)))/2; $yy = $is2[1]-20; }
} elseif($texttype=="2") {
if ($textposition=="1") { $xx = "10"; $yy = 9*strlen($text); }
elseif ($textposition=="2") { $xx = $is2[0]-50; $yy = 9*strlen($text); }
elseif ($textposition=="3") { $xx = "10"; $yy = $is2[1]-10; }
elseif ($textposition=="4") { $xx = $is2[0]-50; $yy = $is2[1]-10; }
elseif ($textposition=="5") { $xx = $c[0]-5; $yy = 9*strlen($text); }
elseif ($textposition=="6") { $xx = "10"; $yy = $c[1]+(2*strlen($text)); }
elseif ($textposition=="7") { $xx = $is2[0]-50; $yy = $c[1]+(2*strlen($text)); }
elseif ($textposition=="8") { $xx = $c[0]-5; $yy = $c[1]+(2*strlen($text)); }
elseif ($textposition=="9") { $xx = $c[0]-5; $yy = $is2[1]-10; }
}
$color = @ImageColorAllocate($image, 0, 0, 0);
if ($texttype=="1") {
imagestring($image,$fontsize,$xx,$yy,$text,$color);
} elseif ($texttype=="2") {
imagestringup($image,$fontsize,$xx,$yy,$text,$color);
}
imagejpeg ($image,$destinationfile);
echo readfile($destinationfile);
imagedestroy($image);
}
MakeImage ("sample.jpg","sBForum WebSite",time() . ".png");
?>
شو رأيكم بالتعديل ؟؟
ننتظر المزيد