绘制图形示例

时间:4年前   阅读:4802

<?php
$im = imagecreatetruecolor(100,100);  //imagecreatetruecolor() 函数用于创建一幅空白图像。   imagecreate() 和 imagecreatetruecolor() 函数用于创建一幅空白图像。
$red = imagecolorallocate($im,255,0,0); //红色
$green = imagecolorallocate($im,0,255,0);//绿色
$blue = imagecolorallocate($im,0,0,255); //蓝色

//magefilledarc 画椭圆弧且填充
imagefilledarc($im,50,50,100,100,0,75,$red,IMG_ARC_PIE); //弧线   弧线连圆弧两端  IMG_ARC_PIE和IMG_ARC_CHORD(直线连接两端)是互斥的
imagefilledarc($im,50,50,100,100,75,123,$green,IMG_ARC_PIE);
imagefilledarc($im,50,50,100,100,123,360,$blue,IMG_ARC_PIE);//50,50 X,Y轴。  100,100 宽高     123,360  从123度到360度
//$blue,用上面的蓝色,   IMG_ARC_PIE 弧线

header('content-type:image/png');
imagepng($im);
imagedestroy($im);
?>

本站声明:网站内容来源于网络,如有侵权,请联系我们https://www.qiquanji.com,我们将及时处理。

微信扫码关注

更新实时通知

上一篇:浅谈什么样的程序员算得上合格的程序员

下一篇:期权义务方有哪些存在风险

网友评论

请先 登录 再评论,若不是会员请先 注册