问题链接:http://bbs.blueidea.com/thread-2957105-1-1.html
我是使用GD的 imagefilledrectangle 函数来实现的. 不知是否有更好的解法
?View Code PHP1 2 3 4 5 6 7 8 9 10 11 12
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);
?>
上一篇:Flash程序员的成长之路