Bitmap extractor

This is a discussion on Bitmap extractor within the C++ Programming forums, part of the General Programming Boards category; Hi all, I am trying to write an extractor, which is able to read in a valid bitmap and save ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    4

    Bitmap extractor

    Hi all,

    I am trying to write an extractor, which is able to read in a valid bitmap and save it into several smaller bitmaps based on a metrics file.

    I am able to load the bitmap successfully and save it back to a single bitmap using the following example from here.

    However I am clueless next as to how to read the bitmap info such that I can save different portions of the bitmap into different files instead just reading everything back into a single bitmap.

    Can anyone give me an idea how to proceed or am I going in the wrong direction all these while

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    (I've never done this myself...)

    You should be able to use some of the Microsoft Bitmap Functions to read & manipulate arrays of pixels. Maybe start with GetDIBits() ???

    And/or, go to wotsit.org and download the BMP spec. You could write your own code to parse the BMP file.

    With all of the "Ifs, "ands" & "buts" in the BMP spec it's probably easier to use the Microsoft library functions. In any case, it wouldn't hurt to have a basic understanding of the BMP file structure.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    4
    wotsit.org works great for me thx!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 09:43 AM
  2. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 05:04 PM
  3. Loading a Bitmap resource for OpenGL Texture[x]
    By the dead tree in forum Game Programming
    Replies: 4
    Last Post: 08-26-2004, 02:12 PM
  4. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 10:07 AM
  5. texture is all white in opengl!
    By Crossbow in forum Game Programming
    Replies: 7
    Last Post: 03-31-2002, 11:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21