19,469
社区成员
发帖
与我相关
我的任务
分享
CClientDC rdc(this);
CDC dc1,dc2;
CBitmap bmp1,bmpd;
BITMAP bitmap;
bmp1.LoadBitmap(IDB_BITMAP);
bmp1.GetBitmap(&bitmap);
bmpd.CreateBitmap(bitmap.bmWidth,bitmap.bmHeight,1,bitmap.bmBitsPixel,NULL);
dc1.CreateCompatibleDC(&rdc);
dc1.SelectObject(&bmp1);
LPBYTE lpbts;
int ncount=0;
ncount=(bitmap.bmHeight*bitmap.bmWidthBytes);
lpbts=new BYTE[ncount];
bmp1.GetBitmapBits(ncount,lpbts);
bmpd.SetBitmapBits(ncount,lpbts);