您的位置:首页 > 其它

GD2绘制基本图形

2017-11-22 10:49 176 查看
一 代码

<?php
header("Content-type: image/png");    //将图像输出到浏览器
$img = imagecreate(560, 200);      //创建一个 560×200 的图像
$bg = imagecolorallocate($img, 0, 0, 255);
//设置图像背景色
$white = imagecolorallocate($img, 255, 255, 255);
//设置绘制图像的颜色为白色
imageline($img, 20, 20, 150, 180, $white);
imagearc($img, 250, 100, 150, 150, 0, 360, $white);
//绘制一个白色的圆
imagerectangle($img, 350, 20, 500, 170, $white);
imagepng($img);
imagedestroy($img);
?>

 

二 运行结果



 





大小: 1.9 KB

查看图片附件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: