php中的绘图

<?php

/*燕十八 公益PHP培训  

课堂地址:YY频道88354001  

学习社区:www.zixue.it 

	//创建画布

	$im=imagecreatetruecolor(300,100);

	//定义画布的颜色

	$white=imagecolorallocate($im,255,255,255);

	//生成图片

	imagefill($im,0,0,$white);

	//画几个圈图

	$gray=imagecolorallocate($im,240,240,240);

	$red=imagecolorallocate($im,255,0,0);

	$gren=imagecolorallocate($im,193,299,202);

	$gray1=imagecolorallocate($im,240,200,240);

	$red1=imagecolorallocate($im,200,0,0);

	$gren1=imagecolorallocate($im,193,299,242);

	//循环画出上面的几个圈图	

	for($i=51;$i<70;$i++){

		imagefilledarc($im,150,$i,80,60,0,60,$red1,IMG_ARC_PIE);

		imagefilledarc($im,150,$i,80,60,60,160,$gray1,IMG_ARC_PIE);

		imagefilledarc($im,150,$i,80,60,160,360,$gren1,IMG_ARC_PIE);

	}

		imagefilledarc($im,150,50,80,60,0,60,$red,IMG_ARC_PIE);

		imagefilledarc($im,150,50,80,60,60,160,$gray,IMG_ARC_PIE);

		imagefilledarc($im,150,50,80,60,160,360,$gren,IMG_ARC_PIE);

	header("image/png");

	//保存图片

	imagepng($im);

	//销毁图片占用的内存

	imagedestory($im);

?>

 

你可能感兴趣的:(PHP)