int GetDIBits( HDC hdc, // handle to DC HBITMAP hbmp, // handle to bitmap UINT uStartScan, // first scan line to set UINT cScanLines, // number of scan lines to copy LPVOID lpvBits, // array for bitmap bits LPBITMAPINFO lpbi, // bitmap data buffer UINT uUsage // RGB or palette index );
BITMAP bmp;
// Retrieve the bitmap's color format, width, and height. if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&bmp)) error!!!
BITMAP 是一个系统结构 typedef struct tagBITMAP { /* bm */ int bmType; int bmWidth; int bmHeight; int bmWidthBytes; BYTE bmPlanes; BYTE bmBitsPixel; LPVOID bmBits; } BITMAP;包含了HBITMAP的基本信息
GetBitmapDimensionEx( hBitmap, &s );
HBITMAP hOldBitmap=(HBITMAP)SelectObject(hMemDC,hBitmap);
int iWidth = GetDeviceCaps( hMemDC, HORZSIZE );
int iHeight = GetDeviceCaps( hMemDC, VERTSIZE );
...
//CBitmap bitmap.LoadBitmap(ID_BITMAP);
bitmap.GetObject(sizeof(bm),&bm);
HDC hdc, // handle to DC
HBITMAP hbmp, // handle to bitmap
UINT uStartScan, // first scan line to set
UINT cScanLines, // number of scan lines to copy
LPVOID lpvBits, // array for bitmap bits
LPBITMAPINFO lpbi, // bitmap data buffer
UINT uUsage // RGB or palette index
);
// Retrieve the bitmap's color format, width, and height.
if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&bmp))
error!!!
BITMAP 是一个系统结构
typedef struct tagBITMAP { /* bm */
int bmType;
int bmWidth;
int bmHeight;
int bmWidthBytes;
BYTE bmPlanes;
BYTE bmBitsPixel;
LPVOID bmBits;
} BITMAP;包含了HBITMAP的基本信息