Code:
<?PHP
error_reporting(E_ALL ^ E_NOTICE);
/*
simplepng.php
Generates a 800 x 300 pixel png of the color passed in parameter 'color'
*/
// Step 1. Create a new blank image
$im = imageCreate(800,300);
imageLine($im,25,20,125,80,255);
imageRectangle($im,0,0,599,299,255);
imagestring($im, 5, 0, 0, "Hello world!", 255);
// Step 2. Set background to transparent
$background = imageColorAllocate ($im, 0, 0, 0);
$background = imageColorTransparent($im,$background);
// Step 3. Send the headers (at last possible time)
header('Content-type: image/png');
// Step 4. Output the image as a PNG
imagePNG($im);
// Step 5. Delete the image from memory
imageDestroy($im);
?>
Try that. I've put a few lines that it can draw in there too. This is basically the same as an example on a site somewhere. I modified it for my own purposes, but this is pretty much what was on the site. I don't yet know how to put an image beneath the text and stuff, as I having needed to find out for my purposes, but that should be a start
.
EDIT - found the site: http://www.nyphp.org/content/present...Dintro/gd9.php