How to write BITMAP structure to xml file?
-
However the hell you want!!?! Define the structure you'll use to store the info, then fill it - simple. If you need a prod-along, why not just make the XML file hold ( a subset of) the same info as the BMP file would, in the same order. E.g for a 5x5 pixel red square, I may use something like: 5 5 1 24 0 2835 2835 0 0 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 One of the many problems with his approach is, that I can't remember if compressed pixels runs are allowed to cross scanLine boundaries (one compressed stream may not end at the end of the scanline it was begun in) Please excuse me if it's a little forward, but why don't you use ZLib? Instead of busting up all the files for transfer and storing the info into a single large XML file, you could just compress the files together into an archive, and send that. This should provide you with smaller transfers & faster execution since the files are all binary rather than textual representations of the same binary data.
-
However the hell you want!!?! Define the structure you'll use to store the info, then fill it - simple. If you need a prod-along, why not just make the XML file hold ( a subset of) the same info as the BMP file would, in the same order. E.g for a 5x5 pixel red square, I may use something like: 5 5 1 24 0 2835 2835 0 0 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 FF 00 00 One of the many problems with his approach is, that I can't remember if compressed pixels runs are allowed to cross scanLine boundaries (one compressed stream may not end at the end of the scanline it was begun in) Please excuse me if it's a little forward, but why don't you use ZLib? Instead of busting up all the files for transfer and storing the info into a single large XML file, you could just compress the files together into an archive, and send that. This should provide you with smaller transfers & faster execution since the files are all binary rather than textual representations of the same binary data.
thanks for your suggestions. Let me give you broader view of what Im trying to do.. Im developing an application that needs to send xml files to a mac system. A similar app on mac should be able to open and interpret the files. Now the xml file has a header and a data parts. The Data part will contain multiple node hierarchies as the one that follows: <item> <id> 123 </id> .... .... <note> some notes</note> <image> <bitmap> <height></height> <width> </width> ... </bitmap> </image> </item> So I can use zlib on such multipe xml files. what say.. Please suggest.