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 :confused:
(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.
wotsit.org works great for me thx!