Home > Backend Development > PHP Tutorial > 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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:09:06
Original
801 people have browsed it

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. ...
Related labels:
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template