 |
|
สวัสดีค่ะ
ปัญหาคือ Upload ไฟล์เว็บต่าง ๆ ขึ้นไปบน server แล้วผลออกมาเป็นแบบนี้ค่ะ
Code
Warning: imagettfbbox() [function.imagettfbbox]: Could not find/open font in /home/ajsombat/domains/arjarnsombat.com/public_html/news_add.php on line 37
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/ajsombat/domains/arjarnsombat.com/public_html/news_add.php on line 44
ซึ่งตอนรันใน localhost ไม่เป็นค่ะ แสดงผลปกติดี (เอา font ใส่ไว้ใน folder ที่ชื่อ font แล้วเซ็ตเปอมิดชั่นเป็น 777 แล้ว)
โค้ดบรรทัดที่ error คือบรรทัดที่ขีดเส้นใต้ค่ะ
Code (PHP)
$im = ImageCreate($width, $height);
$grey = ImageColorAllocate($im, 230, 230, 230);
$black = ImageColorAllocate($im, 0, 0, 0);
$font = "font/Tahoma.ttf";
$text_bbox = ImageTTFBBox($font_size, 0,$font, $text);
$image_centerx = $width / 2;
$image_centery = $height / 2;
$text_x = $image_centerx - round(($text_bbox[4]/2));
$text_y = $image_centery + 6;
ImageTTFText($im, $font_size, 0, $text_x, $text_y, $black,$font, $text);
ImagePng($im,"image-code.png");
ImageDestroy ($im);
ขอบคุณค่ะ
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2011-08-29 10:08:23 |
By :
november17 |
View :
1521 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |