bit map bits

......
HDC hdc;
HDC mdc;
BITMAP bm;
HBITMAP hBmp;
unsigned char *px; // 指向存储像素的地址

hdc = GetDC(hWnd);
mdc = CreateCompatibleDC(hdc);
hBmp = LoadImage(NULL, "olive.bmp", IMAGE_BITMAP, 40, 40, LR_LOADFROMFILE);

GetObject(hBmp, sizeof(BITMAP), &bm);
px = new unsigned char[bm.bmHeight * bmWidthBytes];
GetBitmapBits(hBmp, bm.bmHeight * bm.WidthBytes, px); 

你可能感兴趣的:(image,null,存储)