How to write to a file in Binary
Quote:Original post by crazy_andy
I'm sorry, but that makes no sense to me, could you give me a quick example
Essentially what he's saying is that if you write "0" to a file you're actually writing the ASCII equivalent of the character 0 to the file and not %00000000 (that's the number 0 in binary).
What you also need to know is exactly how the TGA file format is structured, and the correct file headers (so; bits per pixel, image width/height, if there's an alpha channel or not) in much the same way as an HTML document has a head element containing information like the page title. Except that in an image file you must have all this info.
Hence getting an image library to do it is much easier.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement