在窗口中贴图主讲人:孙鑫
http://www.sunxin.org
在窗口中贴图
1、创建位图
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
2、创建兼容 DC
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(pDC);
3、将位图选到兼容 DC中
dcCompatible.SelectObject(&bitmap);
4、将兼容 DC中的位图贴到当前 DC中。
pDC->BitBlt(rect.left,rect.top,rect.Width(),
rect.Height(),&dcCompatible,0,0,SRCCOPY);
位图兼容 DC 当前 DC
④③
http://www.sunxin.org