by Fuzzy » Wed Jun 13, 2007 5:59 pm
An uncompressed TGA 24 bit is about as easy as it gets. Try that.
Save one to disk, uncompressed, true color. Crack open your hex editor, and find the X and Y matching values. The other 16 or so bytes you can just copy direct. That does it for the header.
So you copy the 18 bytes at the beginning, replacing the values for the X and Y. After that append your RGB values, but they go in reverse order... BGR. if your image is 16x16, then you need to write 3x256 or 768 bytes after the 18 byte header.
When you go to load one, check the file length. It should be 786 bytes. If it matches, then you can check each element of the header. If they all match up, then read the body of the file(offset 18 from the beginning) to an array or 3 arrays, as you choose.
How about I write a function for read and write later today? I have a specialized one i can modify for you.
Mortal Enemy of IF....THEN(and Inspector Gadget)
Still ThreeFingerPete to tekdino