php画一个背景透明,且开始处旋转到在圆的正下方处的一个圆饼统计图
img
/* * _survey 得到一个投票的圆饼图 * @access public 表示函数对外公开 * @param $_agree 同意票数 * @param $_disagree 反对票数 * return 一张统计圆饼图 * */ function _vote($_agree,$_disagree){ //处理参数 if($_agree==0&&$_disagree==0){ $_vote = 270; } if($_agree==0&&$_disagree!=0){ $_vote = 91; } if($_agree!=0&&$_disagree==0){ $_vote = 89; } if($_agree!=0&&$_disagree!=0){ $_vote = intval(360*($_agree/($_agree+$_disagree))+90); } //创建画布 $_img=imagecreatetruecolor(150,100); //填充透明背景 imagealphablending($_img, false); imagesavealpha($_img, true); $white = imagecolorallocatealpha($_img,255,255,255,127); imagefill($_img,0,0,$white); //创建颜色 $_green=imagecolorallocate($_img,180,210,52); $_blue=imagecolorallocate($_img,83,201,237); $_gary=imagecolorallocate($_img,192,192,192); $_green1=imagecolorallocate($_img,149,178,36); $_blue1=imagecolorallocate($_img,41,160,193); $_gary1=imagecolorallocate($_img,144,144,144); for($i=60;$i>=50;$i--){ imagefilledarc($_img,100,$i,100,50,90,$_vote,$_blue1,IMG_ARC_PIE); imagefilledarc($_img,100,$i,100,50,$_vote,90,$_green1,IMG_ARC_PIE); } imagefilledarc($_img,100,$i,100,50,90,$_vote,$_blue,IMG_ARC_PIE); imagefilledarc($_img,100,$i,100,50,$_vote,90,$_green,IMG_ARC_PIE); header("content-type: image/png"); imagepng($_img); imagedestroy($_img); }
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章
刺客信条阴影:贝壳谜语解决方案
3 周前
By DDD
Windows 11 KB5054979中的新功能以及如何解决更新问题
2 周前
By DDD
在哪里可以找到原子中的起重机控制钥匙卡
3 周前
By DDD
节省R.E.P.O.解释(并保存文件)
1 个月前
By 尊渡假赌尊渡假赌尊渡假赌
刺客信条阴影 - 如何找到铁匠,解锁武器和装甲定制
4 周前
By DDD

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)
