1

我正在使用 PHP 5 GD Lib 进行一些图形操作,但是当您旋转图像或将图像复制到另一个(更大的)图像时,我找不到解决黑色背景的方法。

假设我正在使用一个当然不透明的 JPEG 文件,我如何使用 GD Lib 旋转图像并最终得到白色背景/画布,而不是黑色背景?

4

1 回答 1

3

This comment is from the PHP documentation and credit goes to "weareexit at yahoo dot co dot uk"

"If you want to place an image on a larger canvas you've previously created with imagecreatetruecolor(), but you don't want the default black background to surround it: use imagefill() AFTER imagecopyresampled()."

于 2008-12-09T17:08:42.110 回答