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); >