There is a set of image functions in PHP that can dynamically generate the image data stream in GIF format and output it to the server. In order for this set of functions to work, the system must have the support of the GD library. If it is under UNIX, you should get GD source code and compile it before compiling PHP, generate libgd.a and some. h files, and copy them to the system's library directory and header file directory (for example,/usr/lib and/usr/ Include); if it is under Windows, the PHP3.0 installer installs a Gd.dll file, adding a ' DL ' ("Gd.dll") to the program; ' You can use the image function.
Imagecolorset (image descriptor, color descriptor, red, green, blue);
Imagecolorsforindex (image descriptor, color descriptor);
Imagecolorstotal (image descriptor);
The first three returns a color descriptor. Imagecolorexact returns 1 if no match is found.
Imagecolorsforindex returns an array of three items, with the elements red, green, and blue respectively.
Imagecolorstotal returns the total number of colors.
(9) Imagefontheight,imagefontwidth
Receives a font number as an argument.
(10) Imagegif (image descriptor, [filename]);
If no file name is available, the GIF stream is sent to the browser. At this point, the program should have a first sentence: Header ("Content-type:image/gif")
(11) Imagedestroy (image descriptor);
There is a small bug in the image function (at least in the PHP3.0RC and PHP3.0RC3 for UNIX source code has been found, now www.php.net on the download file should have been changed), that is, Imagesetpixel always draw points at (Y,y), No matter what the value of x is, the problem is not very large.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service