extension=php_gd2.dll
Create canvas
Canvas, a resource type data, operable image resource
Operation canvas
Assign color: If you need to use a certain color on the canvas, you should assign the color to the canvas first.
(color identification) = imageColorAllocate(img,r,g,b)
fill canvas
imageFill(img,x,y,color identification)
output canvas
1, output to image file
2. For direct output, you need to tell the browser to output image information (header("Content-type:image/png;"))
imagePNG(img[,url])
imageJPEG()
imageGIF()
Destroy canvas resources
imageDestroy(img)
header('content-type:image/png'); $img = imagecreate(300,300); $color = imagecolorallocate($img,223,22,44); imagefill($img,3,3,$color); imagepng($img); imagedestroy(); ?>
The above has introduced the GD of PHP, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.