GD2填充几何图形

来源:互联网 发布:大学生使用网络情况 编辑:程序博客网 时间:2024/05/29 09:32

一 代码

<?php    header("Content-type: image/png");    //将图像输出到浏览器    $img = imagecreate(400, 200);      //创建一个 400×180 的图像    $bg = imagecolorallocate($img, 0, 0, 255);             $white = imagecolorallocate($img, 255, 0, 255);           imagefilledellipse($img, 100, 100, 150, 150, $white);    //绘制圆形          imagefilledrectangle($img, 200, 50, 300, 150, $white);    //绘制正方形imagepng($img);imagedestroy($img); ?>

 

二 运行结果

 
  • 大小: 1.3 KB
  • 查看图片附件
原创粉丝点击