 |
|
จาก code นี้ค่ะ
Code (PHP)
<?
$height = 464;
$width = 464;
echo "<img src=images/source.jpg>";
$font = 'psldisplay.ttf';
$string = "TEST"; // String
$font_size = 45;
$im = ImageCreateFromJpeg("images/source.jpg"); // Path Images
$color = ImageColorAllocate($im, 255, 0, 0); // Text Color
$text_bbox = ImageTTFBBox($font_size, 0, "psldisplay.ttf", $string);
$image_centerx = $width / 2;
$image_centery = $height / 2;
//$text_x = $image_centerx - round(($text_bbox[4]/2));
$text_x = $image_centerx;
$text_y = $image_centery;
//ImagettfText($im, 20, 0, $pxX, $pxY, $color, $font, $string);
//ImagettfText($im, 20, 0, $text_x, $text_y, $color, $font, $string);
ImageTTFText($im, $font_size, 0, $text_x, $text_y, $color, "psldisplay.ttf", $string);
imagePng($im,"images/source.jpg");
ImageDestroy($im);
?>

จาก code ด้านบน ปัญหาที่เกิดขึ้นตามภาพเลยจ้า ตัวอักษร จาก TEST จะเป็น สี่เหลี่ยม
และไม่จัดกึ่งกางอ่ะจ้า รบกวนแนะนำทีนะคะ
ขอบคุณมากเลยค่ะ
Tag : PHP, HTML/CSS, JavaScript
|
|
 |
 |
 |
 |
Date :
2013-10-27 11:16:22 |
By :
because |
View :
790 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |