PHP allocate color without image resource

前端 未结 4 941
孤独总比滥情好
孤独总比滥情好 2020-12-04 03:08

Can you allocate a color in PHP GD without an image resource? It should be possible because really an allocated color is a number, right?

$im = imagecreatet         


        
4条回答
  •  既然无缘
    2020-12-04 03:32

    It should be possible because really an allocated color is a number, right?

    No, it's not. GD may also have to register that color in the palette of the image (think non true color images).

    So you need an image resource.

提交回复
热议问题