php生成渐变图片(0 位领导批示)

问题链接:http://bbs.blueidea.com/thread-2957105-1-1.html

我是使用GD的 imagefilledrectangle 函数来实现的. 不知是否有更好的解法

1
2
3
4
5
6
7
8
9
10
11
12
<?php
$im = imagecreate(255, 255);
$bg = imagecolorallocate($im, 0, 0, 0);
for($i=255; $i>=0; $i--)
{
    $color = imagecolorallocate($im, $i, $i, $i);
    imagefilledrectangle($im, 0, $i, 255, 1, $color);
}
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
Tags : , , ,

随机显示的10篇日志

评论最多的10篇日志

浏览最多的10篇日志