PHP generates a percentage of 3D graphics statistical effects This program is based on user-supplied data to produce a percentage of 3D effects picture statistic effect a bit like China webmaster
Create multiple, differentiated colors
$red = Imagecolorallocate ($image, 255,0,0);
$blue = Imagecolorallocate ($image, 0,0,255);
$yellow = Imagecolorallocate ($image, 255,255,0);
$violet = Imagecolorallocate ($image, 255,0,255);
$white = Imagecolorallocate ($image, 255,255,255);
$black = Imagecolorallocate ($image, 0,0,0);
Create a 3d effect bottom effect with a for loop
for ($i =120; $i >100; $i-) {
Imagefilledarc ($image, $i, 200,120,0,30, $red, img_arc_pie);//img_arc_pie notes are as follows:
Imagefilledarc ($image, $i, 200,120,30,80, $blue, Img_arc_pie);
Imagefilledarc ($image, $i, 200,120,80,360, $yellow, Img_arc_pie);
}
BOOL Imagefilledarc (resource image, int cx, int cy, int w, int h, int s, int e, int color, int style)
//
Imagefilledarc () draws an elliptical arc in the image represented by the image as Cx,cy (0, 0) in the upper-left corner. Returns true if successful, and false if it fails. W and H Specify the width and height of the ellipse respectively, and the S and e parameters specify the starting and ending points with an angle. The style can be a bitwise or (or) value after the following values:
//
Img_arc_pie
//
Img_arc_chord
//
Img_arc_nofill
//
Img_arc_edged
This layer is the top layer of the effect, so the stereo effect is out!
Imagearc ($image, 100,100,200,120,0,360, $black);//Add a black rim so that the 3d effect looks more obvious.
Imagefilledarc ($image, 100,100,200,120,0,30, $red, Img_arc_pie);
Imagefilledarc ($image, 100,100,200,120,30,80, $blue, Img_arc_pie);
Imagefilledarc ($image, 100,100,200,120,80,360, $yellow, Img_arc_pie);
Add a percentage of data, of course, when necessary in this case can be batch of a certain operation will input input to the image
$str = Iconv ("GBK", "Utf-8", "36%");//If you want to enter Chinese, this conversion is required. Example: occupancy: 30%;
Imagettftext ($image, 10,360-15,100+70,115, $white, "Simhei.ttf", $str);
Imagejpeg ($image);
Imagedestroy ($image);
http://www.bkjia.com/PHPjc/633030.html www.bkjia.com true http://www.bkjia.com/PHPjc/633030.html techarticle PHP generates 3D percent graphical statistical effect this program is based on user-supplied data to generate a percentage of 3D effects picture statistical effects have a bit like the Chinese webmaster PHP tutorial generated 3d percent graphics ...