The last time we talked about using GD for various geometric figures and fill colors. This is a complicated situation.
Leave it behind, which is the fill color of any polygon and any polygon.
<?
Header ("Content-type: image/png ");
$ Im = ImageCreate (200,100 );
$ Col_blk = ImageColorAllocate ($ im, 0, 0 );
$ Col_grn = ImageColorAllocate ($ im, 0,255, 0 );
$ Parray = array );
// Define an array. The 12 members are the horizontal and vertical coordinates of the six points.
ImagePolygon ($ im, $ parray, 6, $ col_grn );
// This is the function for drawing arbitrary polygon. $ parray is the defined array,
// 6 indicates six points. Note that six points are connected to a hexagonal structure.
// You do not have to add the same vertex at the end to close the graph.
ImagePNG ($ im );
ImageDestroy ($ im );
?>
You should have thought of the function of filling any polygon color:
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