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. Questions about the BITMAP structure.

Questions about the BITMAP structure.

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphics
4 Posts 3 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.
  • R Offline
    R Offline
    redeemer
    wrote on last edited by
    #1

    1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line? 2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes? 3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use? Thanks in advance.

    B 1 Reply Last reply
    0
    • R redeemer

      1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line? 2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes? 3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use? Thanks in advance.

      B Offline
      B Offline
      Bill Wilson
      wrote on last edited by
      #2

      a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels. the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.

      R 1 Reply Last reply
      0
      • B Bill Wilson

        a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels. the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.

        R Offline
        R Offline
        redeemer
        wrote on last edited by
        #3

        Thankyou. How do i then create a valid bitmap picture that can be opened in any picture viewer? Do i just use WriteFile? If so, how do i use it? What should i pass as the parameter that should be written and how many bytes shoul di write? Thanks

        C 1 Reply Last reply
        0
        • R redeemer

          Thankyou. How do i then create a valid bitmap picture that can be opened in any picture viewer? Do i just use WriteFile? If so, how do i use it? What should i pass as the parameter that should be written and how many bytes shoul di write? Thanks

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          If you have a BITMAPINFO structure, then you can write it out to disk, using IOStreams or Microsoft specific methods. GDI+ will do this for you, for bmp/jpg/gif/I forget the others. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002 Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002

          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