Php draws a five-star red flag based on the GD Library. Php uses the GD library to draw a five-star red flag. the phpgd Library's five-star red flag example describes how php draws a five-star red flag based on the GD Library. Share it with you for your reference. The specific analysis is as follows: this php method draws a five-star red flag based on the GD library, and the phpgd Library's five-star red flag
This example describes how to draw a five-star red flag in php based on the GD Library. Share it with you for your reference. The specific analysis is as follows:
Here we will analyze the five-star red flag (GD library) drawn by php. the code is as follows:
The code is as follows:
<? Php
Header ("Content-Type: image/jpeg ");
$ Ing = imagecreatetruecolor (700,410 );
// Create a true color image. the returned value is an image identifier. the default background is black. the parameter (x_size * y_size)
$ Red = imagecolorallocate ($ ing, 255, 0, 0); // defines the background color.
$ Yellow = imagecolorallocate ($ ing, 237,231, 32); // defines the yellow color.
Imagefill ($ ing, $ red); // fill color, starting with coordinates ()
// Array coordinate, indicating (x1, y1, x2, y2, x3, y3.... x11, y11 );
$ A = array (119,102,135,152, 93,123, 52,152, 66,102 );
Imagefilledpolygon ($ ing, $ a, 10, $ yellow); // draw a polygon: 10 indicates the total number of vertices, and $ yellow indicates the fill color.
$ A1 = array (, 25 );
Imagefilledpolygon ($ ing, $ a1, 10, $ yellow );
$ A2 = array (227,108,227,127,245,134,228,139,227,157,215,143,196,149,208,132,196,117,215,122,227,108 );
Imagefilledpolygon ($ ing, $ a2, 10, $ yellow );
$ A3 = array (163,184,163,204,181,211,163,216,163,234,152,220,132,225,144,209,132,193,151,199,163,184 );
Imagefilledpolygon ($ ing, $ a3, 10, $ yellow );
$ A4 = array (65,209, 65,228, 84,235, 65,240, 65,259, 54,245, 33,249, 46,233, 34,217, 53,224, 68,209 );
Imagefilledpolygon ($ ing, $ a4, 10, $ yellow );
Ob_clean ();
Imagejpeg ($ ing );
Imagedestroy ($ ing );
?>
I hope this article will help you with php programming.
Examples in this article describe how php draws a five-star red flag based on the GD Library. Share it with you for your reference. The specific analysis is as follows...