Showing posts with label imagecolorallocate. Show all posts
Showing posts with label imagecolorallocate. Show all posts

Friday, 2 October 2009

Create A GIF

//create an image 400 by 200 pixels
$img = imagecreate(400,200);
//set variable $red to be red
$red = imagecolorallocate($img,255,0,0);
//draw a rectangle
Imagerectangle($img,50,50,150,150,$red);
//create apng
ImageGIF($img,"pic.gif");
//clean up resources
ImageDestroy($img);
?>