PHP uses GD library to draw and generate verification code pictures
First you have to determine if the php.ini setting has the GD extension function, test the following
Print_r (Gd_info ());
If there is a printout of the content as follows, then the GD feature is open:
Array ( [GD Version] = bundled (2.0.34 compatible) [FreeType support] + 1 [FreeType Linkage] = Wit H FreeType [t1lib support] + 1 [gif Read support] + 1 [gif Create support] + 1 [JPG support] = > 1 [PNG support] = 1 [WBMP support] + 1 [XPM support] = [XBM support] + 1 [JIS -mapped Japanese Font Support] =)
GD drawing general steps are as follows:
1. Create a canvas resource
2. Create a color brush
3. Drawing
4. Save picture or Output picture
5. Destroying the Memory canvas resource
The test code is as follows:
The test image is as follows:
Note: GD library powerful can draw various reports (such as histogram, pie chart, etc.), thumbnails, watermark and stock charts
Thumbnail function Examples: