您可以从内存中的映像在PHP中创建GD映像吗?


Can you create a GD image in PHP from an image in memory?

我需要像imagecreatefromng()这样的函数,但我想直接传递图像(而不是文件名)。这可能吗?

注意:我需要这个,因为图像来自数据库中的blob。

imagecreatefromstring()

它应该从图像头中检测到它是一个png,并返回一个图像资源

是的,您可以使用imagecreatefromstring()

ttp://us2.php.net/manual/en/function.imagecreatefromstring.php