 |
|
โค้ดสำหรับสร้างบาร์โค้ดครับ คือผมต้องการให้มันรับค่า $text รับค่ามา จาก txetbox ของอีกหน้านึ้งอะครับ ต้องเขียนโค้ดเพิ่มยังไงครับ
<?php
$text = "1111111";
$font_size = 40;
$height = 100;
$width = 200;
$im = ImageCreate($width, $height);
$grey = ImageColorAllocate($im, 230, 230, 230);
$black = ImageColorAllocate($im, 0, 0, 0);
$text_bbox = ImageTTFBBox($font_size, 0, "FRE3OF9X.TTF", $text);
$image_centerx = $width / 2;
$image_centery = $height / 2;
$text_x = $image_centerx - round(($text_bbox[4]/2));
$text_y = $image_centery;
ImageTTFText($im, $font_size, 0, $text_x, $text_y, $black, "FRE3OF9X.TTF", $text);
ImagePng($im,"MyResize/image.png");
ImageDestroy ($im);
echo "<img src=MyResize/image.png>";
?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2012-03-02 15:11:48 |
By :
addy_it |
View :
1307 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |