Tech Support > Microsoft Windows > Development Resources > What is the structure of bit map pointed by bmBits, a member of BITMAP structure
What is the structure of bit map pointed by bmBits, a member of BITMAP structure
Posted by Liu Ju on October 27th, 2004


Dear friends:

I am trying to get color of each pixel in a monochromo bitmap.
I am wondering how I can get it from BITMAP structure.

I creat a CImage, load an image from hardisk to the CImage object,
call the function CImage.GetBitMap() to obtain a pointer to the BITMAP
strucre.

I see in the BITMAP structure the pointer bmBits to image bit array. I
guess I can access this array in order to figure out the color (black
or white) of any pixel on the bitmap.
I am wondering if my method is independent to the device (CDC)?
and if it is ok, please tell me the structure of that array. I mean
What funcation I should call if I want to to figure out the color of
the pixel (coordinate: x,y) one a monochrome image?


One more confusion, in the BITMAP the bmBits pointer has a long type.
However in the MSDN it tell s that the pointer points to a 1 BYTE
array. I am wondering how it can do that. in my understanding if its
type is long pointer, it must point to a long array. where am I
missing the way?

Thank you and look forward to your reply.

Sincerely yours


Similar Posts