zoukankan      html  css  js  c++  java
  • PHP中的绘图技术画比例圆

    <?php
    /*
    燕十八 公益PHP培训    课堂地址:YY频道88354001   学习社区:www.zixue.it 原型图测试文件
    */
    	header('content-type:text/html;charset=utf-8');
    	//POST接受数据
    	$smaller = $_POST['smaller']+0;
    	$middle = $_POST['middle']+0;
    	$college = $_POST['college']+0;
    	$doctor = $_POST['doctor']+0;
    	$all = $smaller+$middle+$college+$doctor;
    	$one = ($smaller/$all)*360;
    	$two = ($middle/$all)*360;
    	$three = ($college/$all)*360;
    	$four = ($doctor/$all)*360;
    	//画布
    	$im = imagecreatetruecolor(300,200);
    	//颜料
    	$color = imagecolorallocate($im,255,255,255);
    	$color1 = imagecolorallocate($im,0,50,40);
    	$color2 = imagecolorallocate($im,0,50,255);
    	$color3 = imagecolorallocate($im,0,250,0);
    	$color4 = imagecolorallocate($im,50,50,30);
    	$color5 = imagecolorallocate($im,255,255,255);
    	$color6 = imagecolorallocate($im,255,255,51);
    	$color7 = imagecolorallocate($im,255,27,255);
    	$color8 = imagecolorallocate($im,25,27,255);
    	$color9 = imagecolorallocate($im,25,27,55);
    	//填充
    	imagefill($im,0,0,$color);
    	//画图
    
    	imagefilledarc($im,102,102,105,105,0,360,$color7,4);
    	imagefilledarc($im,100,100,100,100,0,$one,$color1,0);
    	//画矩形
    	imagefilledrectangle($im,5,5,30,30,$color1);
    	imagefttext($im,5,0,7,20,$color5,'simhei.ttf','小学生');
    
    	imagefilledarc($im,100,100,100,100,$one,$one+$two,$color2,0);
    	//画矩形
    	imagefilledrectangle($im,35,5,60,30,$color2);
    	imagefttext($im,5,0,37,20,$color5,'simhei.ttf','中学生');
    
    	imagefilledarc($im,100,100,100,100,$one+$two,$one+$two+$three,$color3,0);
    	//画矩形
    	imagefilledrectangle($im,65,5,90,30,$color3);
    	imagefttext($im,5,0,67,20,$color5,'simhei.ttf','大学生');
    	
    	imagefilledarc($im,100,100,100,100,$one+$two+$three,$one+$two+$three+$four,$color4,0);
    	//画矩形
    	imagefilledrectangle($im,95,5,120,30,$color4);
    	imagefttext($im,5,0,97,20,$color5,'simhei.ttf','博士生');
    
    	header('content-type:image/jpeg');
    	imagejpeg($im);
    	imagedestroy($im);
    
  • 相关阅读:
    006开源O/R映射框架内容回顾
    005---query接口初步
    004---持久对象的生命周期介绍
    C++中计算矩阵的行列式
    异面直线判定
    华夏万家不投资最佳激活顺序
    飞行目标定位测量相关文献记录
    程序运行缺少MSVCR110.dll
    C++中的return返回值:return0 or return -1?
    办宽带
  • 原文地址:https://www.cnblogs.com/luowen/p/2818306.html
Copyright © 2011-2022 走看看