PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How To Properly Load PNG files into GapiDraw?

Based on my information from GapiDraw documentation, if I have a set of .png files stored in GapiVFS, I should them via CGapiFileBuffer::Open().

I can do that, however, then, if I load .png files, I need to know file height, file length, and additional parameters. How to access those parameters, please?

An alternative seems to be loading image file into CGapiSurface(), but this class is designed for outputting data to screen and not to hold dozens of resource images.

Could I kindly ask, what way is the correct one, to load several TileSet .png images into PocketPC memory?

Thank you and with regards,
Rene.
InexorableTash · 20 Feb 2007, 06:53 UTC
Why are you loading images if you're not going to output them to the screen at some point?

If you're loading images, you almost certainly want to use a CGapiSurface, which encapsulates the logic for loading images.

Accessing the VFS directly would be for accessing resource data that GapiDraw doesn't handle natively, such as sound or text files. And in those cases, you'd almost certainly want to hand off the file data coming out of the VFS to another class analogous to CGapiSurface which encapsulates the logic for parsing and manipulating it.
InexorableTash,

Thank you for clarification. yeah, now i understand what the logic, and I agrre that I need to use CGapiSruface() to load all images into memory.

With regards,
Rene.