heres a lil script i made a few weeks ago it lets u create images from text in url theres a few parameters which are
color=COLOR
size=FONT SIZE
text=TEXT
also $font_file replace wif the font u want you'll most likely have to upload the font file for it to work
an example of using this code is
(%20 is a space in url)
color=FF0000&size=40&text=this%20is%20a%20test%20i mage
color=COLOR
size=FONT SIZE
text=TEXT
also $font_file replace wif the font u want you'll most likely have to upload the font file for it to work
an example of using this code is
(%20 is a space in url)
color=FF0000&size=40&text=this%20is%20a%20test%20i mage
PHP Code:
<?php
header("Content-type: image/gif");
//img.php
$hex_color = $_GET['color']?$_GET['color']:"000000";
$r_txt = hexdec(substr($hex_color,0,2));
$g_txt = hexdec(substr($hex_color,2,2));
$b_txt = hexdec(substr($hex_color,4,2));
$_GET['size'] = $_GET['size']?$_GET['size']:30;
$_GET['text'] = $_GET['text']?$_GET['text']:"You have not specified any text!!";
$size = imagettfbbox($_GET['size'],0,"$font_file",$_GET['text']);
$xsize = abs($size[0]) + abs($size[2]);
$ysize = abs($size[5]) + abs($size[1]);
$image = imagecreate($xsize,$ysize);
$bg = imagecolorallocate($image,$r_txt,$g_txt,$b_txt);
$color = ImageColorAllocate($image,$r_txt,$g_txt,$b_txt);
imagettftext($image,$_GET['size'],0,abs($size[0]),abs($size[5]),$color,"$font_file",$_GET['text']);
imagecolortransparent($image,$bg);
imagegif($image);
imagedestroy($image);
?>
Comment