$limited_size)) $result = "حجم الملف أكبر من المسموح به ، أقصى حجم مسموح به هو $limited_size بايت"; }else{ if($aa){ $aa = "$aa.jpg"; if(file_exists($aa)){ readfile($aa); }else{ readfile("notfound.jpg"); } }else{ //صندوق التحميل include("upload.html"); } } //دالة تكون اللون function mkcolor($image,$color){ $color = str_replace("#","",$color); $red = hexdec(substr($color,0,2)); $green = hexdec(substr($color,2,2)); $blue = hexdec(substr($color,4,2)); $out = ImageColorAllocate($image, $red, $green, $blue); return($out); } //هذه الداله تقوم بوضع اسم الموقع في اسفل الصوره التي تمررها لها function aaimage($imagefilename,$websitename,$imagesavefile,$imagefilename_type,$textcolor="#FFFFFF") { //انشاء صوره من الملف المعطى if($imagefilename_type=="jpg"){$im = imageCreateFromjpeg($imagefilename);} if($imagefilename_type=="jpeg"){$im = imageCreateFromjpeg($imagefilename);} if($imagefilename_type=="gif"){$im = imageCreateFromGIF($imagefilename);} if($imagefilename_type=="png"){$im = imageCreateFromPNG($imagefilename);} //انشاء صوره فارغه للرسم عليها $im2= imagecreatetruecolor(imageSX($im),imageSY($im)+22); //وضع لون للنص $text_color = mkcolor($im2,$textcolor); //تحديد مكان كتابة النص حسب طول وعرض الصوره وحسب عدد احرفه $start_text = (imageSX($im2)/2)-9*(strlen($websitename)/2); //كتابة النص في اسفل الصوره ImageString ($im2, 5, $start_text, (imageSY($im)+3), $websitename, $text_color); //دمج الصوره التى الفارغه مع الصوره المعطاه imageCopyMerge($im2, $im,0,0,0,0,(imageSX($im)),(imageSY($im)),100); //حفظ الصوره في ملف imagejpeg ($im2,"$imagesavefile.jpg",100); //مسح الصوره من الذاكره imagedestroy($im2); //مسح الصوره القديمه unlink($imagefilename); } ?>