参考:
typedef struct tagBITMAP { LONG bmType; LONG bmWidth; LONG bmHeight; LONG bmWidthBytes; WORD bmPlanes; WORD bmBitsPixel; LPVOID bmBits; } BITMAP;
typedef struct tagBITMAPINFOHEADER { DWORD biSize; LONG biWidth; LONG biHeight; WORD biPlanes; WORD biBitCount // Specifies the number of bits per pixel.
DWORD biCompression; DWORD biSizeImage; LONG biXPelsPerMeter; LONG biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; } BITMAPINFOHEADER;
// Specifies the number of bits per pixel.
//颜色位数 = 颜色平面数*像素的位数
//平时我们说的24位图,就是rgb三个通道,每个通道8位二进制,3*8=24位
int BitsPerPixel = ddbinfo.bmPlanes*ddbinfo.bmBitsPixel;