VC载入位图方法

VC载入位图方法


       CDC  memDC ;
memDC.CreateCompatibleDC ( &(*dc) ) ;

CBitmap*  pBitmap ; //load all bitmap
CBitmap*  pOldBitmap ; //save old bitmap temp
BITMAP bm;

pBitmap = new CBitmap ;
pBitmap->LoadBitmap(IDB_BITMAP_BAT0);
pOldBitmap = memDC.SelectObject(pBitmap);

pBitmap->GetBitmap(&bm); 
dc->BitBlt(m_rcBattery.left, m_rcBattery.top,bm.bmWidth, bm.bmHeight, &memDC, 0, 0, SRCCOPY);

memDC.SelectObject(pOldBitmap);
DeleteObject(&memDC);
delete pBitmap ;

你可能感兴趣的:(MFC&,界面,delete)