Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to write BITMAP structure to xml file?

How to write BITMAP structure to xml file?

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsxmltutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VC Maniac
    wrote on last edited by
    #1

    I have a BITMAP structure. I need to write it to a xml file. How do I do this?

    enhzflepE 1 Reply Last reply
    0
    • V VC Maniac

      I have a BITMAP structure. I need to write it to a xml file. How do I do this?

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      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.

      V 1 Reply Last reply
      0
      • enhzflepE enhzflep

        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.

        V Offline
        V Offline
        VC Maniac
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups