HBITMAP hBitmap=LoadBitmap(AfxGetInstanceHandle(),(LPSTR)IDB_BITMAP1); 如果位图的ID定义为'IDB_BITMAP1'则 HBITMAP hBitmap=LoadBitmap(AfxGetInstanceHandle(),'IDB_BITMAP1'); 2.CBitmap::LoadBitmap() CBitmap* pBitmap=new CBitmap; pBitmap->LoadBitmap(IDB_BITMAP1); //位图资源ID定义为...
下面用代码演示这种方法: CYourView::OnDraw(CDC* pDC) { CDC memDC;//定义一个兼容DC memDC.CreateCompatibleDC(pDC);//创建DC CBitmap bmpDraw; bmpDraw.LoadBitmap(ID_BMP) ;//装入DDB CBitmap* pbmpOld=memDC.SelectObject(&bmpDraw) ; //保存原有DDB,并选入新DDB入DC pDC->BitBlt(0,0,20,...