William
2005-02-21 08:33:37 UTC
Hi,
Env: Windows2000 SP4, VC++ 6.00
I always get an wrong BITMAP.bmBitsPixel when geting BITMAP using
GetObject().
For example,
(1) I created 32*32, 4bit(16color) bitmap file without compression by
Windows' Painter or just by VC's IDE Resource Editor;
(2) Load it by LoadImage() from my harddiskm, or by LoadBitmap() from the
Resource;
(3)get BITMAP as follows,
BITMAP bm;
int iRet = GetObject(hBmp, sizeof(BITMAP), &bm);
Then, I got bm.bmBitsPixel = 32(WHY NOT 4?)?
And bm.bmWidthBytes = 128(WHY NOT 4)
No matter the orignal file is 8bit(256color), 16bit, or 24bit,
bm.bmBitsPixel always = 32,
and bm.bmWidthBytes = 128.
But if the orignal file is 1bit(monochrome), then bm.bmBitsPixel = 1.
Tell me why if you could.
Thanks!
William
Env: Windows2000 SP4, VC++ 6.00
I always get an wrong BITMAP.bmBitsPixel when geting BITMAP using
GetObject().
For example,
(1) I created 32*32, 4bit(16color) bitmap file without compression by
Windows' Painter or just by VC's IDE Resource Editor;
(2) Load it by LoadImage() from my harddiskm, or by LoadBitmap() from the
Resource;
(3)get BITMAP as follows,
BITMAP bm;
int iRet = GetObject(hBmp, sizeof(BITMAP), &bm);
Then, I got bm.bmBitsPixel = 32(WHY NOT 4?)?
And bm.bmWidthBytes = 128(WHY NOT 4)
No matter the orignal file is 8bit(256color), 16bit, or 24bit,
bm.bmBitsPixel always = 32,
and bm.bmWidthBytes = 128.
But if the orignal file is 1bit(monochrome), then bm.bmBitsPixel = 1.
Tell me why if you could.
Thanks!
William