zoukankan      html  css  js  c++  java
  • 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);
    ?>
    
  • 相关阅读:
    [洛谷P2463][SDOI2008]Sandy的卡片
    后缀数组
    周记【距gdoi:110天】
    hdu3068最长回文(Manacher算法)
    二分图的一些题目合集
    周记【距gdoi:117天】
    二分图、网络流模版总结
    2014end
    周记【距gdoi:126天】
    2-sat
  • 原文地址:https://www.cnblogs.com/luowen/p/2808520.html
Copyright © 2011-2022 走看看