|
 |
|
สร้าง image และ copy ... คือผมทำฟังชั่นสร้างรูปมาแต่อยากให้รูปมันเก็บไว้ที่ folder ที่ผมต้องการครับตัวอย่าง code |
|
 |
|
|
 |
 |
|
คือผมทำฟังชั่นสร้างรูปมาแต่อยากให้รูปมันเก็บไว้ที่ folder ที่ผมต้องการครับตัวอย่าง code ต้องเพิ่มต้องไหนอะครับ
<?php
header("Content-type: text/html; charset=utf-8");
header("Content-type: image/jpeg");
$im = ImageCreateFromJPEG("temnew.jpg"); //ไฟล์รูป
$blue = ImageColorAllocate($im, 255, 0, 255); //text color ที่เป็น
$font = 'font/ARIAL.ttf'; //ฟอน
$text = "GOLF-GAB";
ImageTTFText($im, 14, 0, 200, 200, $blue, $font, $text); //ขนาดของtext และตำแหน่งของtext ที่จะแสดงบนรูป
ImageJPEG($im); ImageDestroy($im); //save to .jpeg เซฟเป็น png เปลี่ยนเป็น ImagePNG($im)
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-05 13:42:30 |
By :
golfgab |
View :
1188 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่อได้แล้ว code ประมาณนี้เลยเผื่อใครอยากได้ลองไปเล่นเด้อ
<?php
header("Content-type: text/html; charset=utf-8");
header("Content-type: image/jpeg");
$im = ImageCreateFromJPEG("temnew.jpg"); //ไฟล์รูป
$blue = ImageColorAllocate($im, 255, 0, 255); //text color ที่เป็น
$font = 'font/ARIAL.ttf'; //ฟอน
$text = "GOLF-GAB";
ImageTTFText($im, 14, 0, 200, 200, $blue, $font, $text); //ขนาดของtext และตำแหน่งของtext ที่จะแสดงบนรูป
$id = md5(date("dmyhis"));
$image = ImageJPEG($im,'image_product/'.$id.'.jpg',85);
ImageDestroy($im);
?>
|
 |
 |
 |
 |
Date :
2009-11-05 14:38:39 |
By :
golfgab |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมยังงอยู่เลย ถามเองตอบเองได้ สุดยอด 
|
 |
 |
 |
 |
Date :
2009-11-06 09:56:15 |
By :
tingtongkub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|