07-06-2009, 11:00 PM
|
#14 (permalink)
|
|
The Contributor
Join Date: May 2009
Location: LA, CA
Posts: 87
Thanks: 0
|
Ok I already lost the one that I wrote. This is from php.net and its almost jsut like it:
PHP Code:
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
What I did was just let it run in the open. And it gives me:
‰PNG IHDRnV,šPLTEé[an÷fIDAT•c` `fxÄÀÃ`Ç ÀçÀä²41ƒ‚€˜Ë–Ý’Àq²@੤;{á0— œi
When I placed this on a separate php file picmaker.php, and used an image tag with the file for its src value it works.
HTML Code:
<img src='picmaker.php' alt='Image created by a PHP script'>
Went through the tutorial again... Sorry, I missed that part, it was there.
|
|
|
|