开发者

Using the GD library for PHP, imagecreatetruecolor(100, 100) returns Resource Id #53?

For some reason imagecreatetruecolor is returning 开发者_Python百科Resource Id #53. Any ideas why?


That's how it works. It does not output an image directly, it generates a handle first, which you then can work on:

$img_handle = imagecreatetruecolor(100, 100);

imagesetpixel($img_handle, $x=50, $y=50, $col=0x2255CC);
...

imagejpeg($img_handle, "output.jpeg");

The last line then generates the final image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜