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.
精彩评论