Home  >  Article  >  Backend Development  >  How to draw a fan shape in php, how to draw a fan shape in php_PHP tutorial

How to draw a fan shape in php, how to draw a fan shape in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:09:06707browse

How to draw a fan in php, how to draw a fan in php

The example in this article describes how to draw a fan shape in PHP. Share it with everyone for your reference. The details are as follows:

php draws a fan shape. Regarding 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". The last parameter has four types. They are:

IMG_ARC_PIE, IMG_ARC_CHORD, IMG_ARC_NOFILL and IMG_ARC_EDGED. For specific parameter descriptions, see the imagefilledarc fan function in the PHP manual.

Copy code The code is as follows:
//1. Create canvas
$im = imagecreatetruecolor(300,200);//Create a new true color image, the default background is black, and return the image identifier. There is also a function imagecreate that has been deprecated.
//2. Draw the required image
$red = imagecolorallocate($im,255,0,0);//Create a color
imagefilledarc($im,100,80,120,90,0,120,$red,IMG_ARC_PIE);//Drawing sector function
//3. Output image
header("content-type: image/png");
imagepng($im);//Output to the page. If there is a second parameter [,$filename], it means saving the image
//4. Destroy the image and release memory
imagedestroy($im);
?>

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/947210.htmlTechArticleHow to draw a fan shape in php, how to draw a fan shape in php. This example describes how to draw a fan shape in php. Share it with everyone for your reference. The details are as follows: php draws a fan shape. ...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn