最近弄的
BITMAPINFO bi;//信息头
void *pBits=NULL;
CRect rect;//客户区窗口
GetClientRect(m_hWnd,&rect);
int nWidth=rect.right;
int nHeight=rect.bottom;
int x=rect.left;
//填充信息头
ZeroMemory(&bi,sizeof(bi));
bi.bmiHeader.biSize=sizeof(bi.bmiHeader);
bi.bmiHeader.biHeight=nHeight;
bi.bmiHeader.biWidth=nWidth;
bi.bmiHeader.biPlanes=1;
bi.bmiHeader.biBitCount=24;
bi.bmiHeader.biCompression=BI_RGB;
bi.bmiHeader.biSizeImage=3*nWidth*nHeight;
//拷贝客户区至内存DC
HDC hActiveDC=::GetDC(m_hWnd);
HDC hActiveWndCompatibleDC=CreateCompatibleDC(hActiveDC);
HBITMAP hActiveWndCompactible