PHP draws a fan-shaped method, and PHP draws a fan method
This example describes how PHP draws a fan-shaped method. Share to everyone for your reference. Specific as follows:
PHP Draws a fan. For the parameter description, except for the last parameter, the others are the same as the parameters of the arc, please refer to the previous article, "How to draw an arc in PHP". There are four types of the last parameter. respectively:
Img_arc_pie, Img_arc_chord, Img_arc_nofill and img_arc_edged, the specific parameters are described in the PHP Manual of the Imagefilledarc painting sector function.
Copy the Code code as follows: <?php
1. Create a canvas
$im = Imagecreatetruecolor (300,200);//Create a new true color image, the default background is black, return the image identifier. There is also a function imagecreate has not been recommended for use.
2. Draw the desired image
$red = Imagecolorallocate ($im, 255,0,0);//Create a color
Imagefilledarc ($im, 100,80,120,90,0,120, $red, img_arc_pie);//Drawing fan function
3. Output image
Header ("Content-type:image/png");
Imagepng ($im);//output to page. If there is a second argument [, $filename], the image is saved
4. Destroy the image and release the memory
Imagedestroy ($im);
?>
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/947210.html www.bkjia.com true http://www.bkjia.com/PHPjc/947210.html techarticle PHP draws a fan-shaped method , and PHP draws a fan-shaped method in this article, which describes the method of drawing a fan in PHP. Share to everyone for your reference. As follows: PHP draws a fan. ...