In PHP before the more commonly used is the GD library to draw images, this use more is the use of verification code. First of all the GD library drawing must have some steps:
First, create the canvas, second, draw the picture outline and Huaben, again the output pattern, and finally the release of resources.
The creation method is as follows:
Imagecreatetruecolor (int width,int height);
Fill Color:
$color =imagecolorallocate ($resouces, int a,int g,int b);
Color Fill:
Imagefill ($resouces, int start,int starty, $color);
Start represents the starting point of the coordinate.
Free resources are used by:
Imagedestroy ($res);
The functions of the output are:
Image+type ($res, [filepath]); There is a second parameter when the save is not output image
To output an image you also need to set the header information:
Header ("Content-type:image/gif");
PHP GD Library