Php draws a sector, and php draws a sector. Php: how to draw a sector. php: how to draw a sector. This article describes how to draw a sector in php. Share it with you for your reference. The details are as follows: php draws a slice. Php to draw a sector, php to draw a sector
This example describes how to draw a slice in php. Share it with you for your reference. The details are as follows:
Php draws a slice. For Parameter descriptions, except for the last parameter, the parameters are the same as those of the arc. for details, refer to the previous "php method for drawing an arc". The last parameter has four types. They are:
IMG_ARC_PIE, IMG_ARC_CHORD, IMG_ARC_NOFILL, and IMG_ARC_EDGED. for details about the parameters, see imagefilledarc in the php Manual.
The code is as follows:
<? Php
// 1. create a canvas
$ Im = imagecreatetruecolor (300,200); // create a real-color image. the default background is black and the image identifier is returned. Another function, imagecreate, is not recommended.
// 2. draw the desired image
$ Red = imagecolorallocate ($ im, 255, 0, 0); // create a color
Imagefilledarc ($ im, 0,120, $ red, IMG_ARC_PIE); // draws a sector function
// 3. output image
Header ("content-type: image/png ");
Imagepng ($ im); // output to the page. If the second parameter [, $ filename] exists, the image is saved.
// 4. destroy images and release memory
Imagedestroy ($ im );
?>
I hope this article will help you with php programming.
Examples in this article describes how to draw a sector in php. Share it with you for your reference. The details are as follows: php draws a slice ....