php生成渐变图片

银子 发布于2009-11-13 10:04 | 209次阅读 | 字体: 打印预览


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

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

?View Code PHP

1 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); ?>photo

photo


本文出处 : http://item.feedsky.com/~feedsky/wuleying/~6971781/368589937/4179567/1/item.html end

上一篇:Flash程序员的成长之路

下一篇:Sina App Engine 试用小记