• 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);
    ?>
    
  • 相关阅读:
    快速幂
    hdu 1595 find the longest of the shortest(迪杰斯特拉,减去一条边,求最大最短路)
    hdu 4121 Xiangqi
    hdu 2224 The shortest path
    hdu4923
    矩阵模板
    hdu4570(区间dp)
    hdu1978(记忆化搜索)
    hdu4283(区间dp)
    hdu1160最长递减子序列及其路径
  • 原文地址:https://www.cnblogs.com/luowen/p/2808520.html
Copyright © 2020-2023  润新知