imagecreate和imagecreatetruecolor()。
php官网中提到
Note:
第一次对 imagecolorallocate() 的调用会给基于调色板的图像填充背景色,即用 imagecreate() 建立的图像。
所以创建image时用imagecreatetruecolor这个方法 具体原因未知
本文介绍了PHP中两种创建图像的方法:imagecreate和imagecreatetruecolor,并推荐使用imagecreatetruecolor来创建图像以避免调色板限制的问题。首次调用imagecolorallocate()将为基于调色板的图像设置背景色,这适用于通过imagecreate创建的图像。
imagecreate和imagecreatetruecolor()。
php官网中提到
Note:
第一次对 imagecolorallocate() 的调用会给基于调色板的图像填充背景色,即用 imagecreate() 建立的图像。
所以创建image时用imagecreatetruecolor这个方法 具体原因未知
219

被折叠的 条评论
为什么被折叠?