PHP draws a fan-shaped method, PHP draws a fan method _php tutorial

Source: Internet
Author: User
Tags image identifier php programming

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. ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.