0

Code is pretty much self explanatory...

I was wonder what $canvas is carry after setting imagecreatetruecolor(360,240)

$canvas=imagecreatetruecolor(360,240);

var_dump($canvas);

Output :

resource(2) of type (gd) 

How can I really get what's going on inside $canvas ?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
iprophesy
  • 175
  • 3
  • 9
  • Great but how come php knows how to deal that black image that stored inside $canvas in that example ? Must be a way to echo what's REALLY going on inside $canvas... – iprophesy Jan 11 '15 at 13:37
  • It's not clear what you're asking. Do you want to obtain an array of bytes representing your image in bitmap format? Or what? Whatever; the internal representation of `$canvas` is abstracted away from you and you should not care about it. Let the library do its job and use its documented functions. – Lightness Races in Orbit Jan 15 '15 at 18:55

0 Answers0