Basic PHP Tutorial: Image function Examples (3)

Source: Internet
Author: User
Tags function examples php tutorial

Basic PHP Tutorial: Image function Examples (3)

Example two: Yin and Yang diagram

<? php$width=400, $height =400, $image =imagecreatetruecolor ($width, $height);//Extract Color $color_black=imagecolorallocate ($ image,0,2,0)///$color _white=imagecolorallocate ($image, 255,255,255);//White $color_blue=imagecolorallocate ($image, 0,0,108);//Blue $color_red=imagecolorallocate ($image, 151,0,4);//Red $color_my=imagecolorallocate ($image, 192,192,255 )///Background $color_temp=imagecolorallocate ($image, 199,199,199);//background//drawing Imagefill ($image, 0,0, $color _white);// The first one is the Great circle Imagefilledarc ($image, $width/2, $height/2, $height, $height, 0,360, $color _blue,img_arc_pie);// Two small round imagefilledellipse ($image, $width/2, $height/4, $height/2, $height/2, $color _red); Imagefilledellipse ($image, $ WIDTH/2, $height/4 * 3, $height/2, $height/2, $color _blue);/*imagefilledellipse--Draw an ellipse and fill * * (Kunming Male Hospital) Imagefilledarc ($ Image, $width/2, $height/2, $height, $height, -90,90, $color _red,img_arc_pie); Imagefilledellipse ($image, $width/2,$ HEIGHT/4 * 3, $height/2, $height/2, $color _blue);//Send object to Header (' content-type:image/png '); Imagepng ($image);/*// Send object to File $filename="ex1.png"; Imagepng ($image, $filename); *///Destroy Object Imagedestroy ($image); >

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.