如何在 OnPaint 中为按钮分配位图?您可以使用 dcMemory 在其他地方调用它吗?
CPaintDC dc(this);
CBitmap bmp, *poldbmp;
CDC Refinery;
//load the bitmap resouce
bmp.LoadBitmap(IDB_BITMAP1);
//create a compataible memory DC
Refinery.CreateCompatibleDC( &dc);
//Select the bitmap into DC
poldbmp = Refinery.SelectObject( &bmp);
//Copy (BitBlt) bitmap from memory DC to screen DC
dc.BitBlt(10,10,100, 100, &Refinery,0, 0, SRCCOPY);
Refinery.SelectObject(poldbmp);