//方法一
CDC memDC;
HBITMAP H_bit;
BITMAP bit;
H_bit = (HBITMAP)LoadImage(::AfxGetInstanceHandle(),
_T("bigbang.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE |
LR_CREATEDIBSECTION);
GetObject(H_bit, sizeof(bit), &bit);
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(H_bit);
pDC->BitBlt(0, 0, bit.bmWidth, bit.bmHeight, &memDC,
0, 0, SRCCOPY);
//方法二<span style="white-space:pre"> </span>
CBitmap C_Bitmap;
<span style="white-space:pre"> </span>HBITMAP H_bitmap;
<span style="white-space:pre"> </span>BITMAP bitmap;
<span style="white-space:pre"> </span>H_bitmap = (HBITMAP)LoadImage(::AfxGetInstanceHandle(),
<span style="white-space:pre"> </span>_T("bigbang.bmp"), IMAGE_BITMAP,0,0,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
<span style="white-space:pre"> </span>C_Bitmap.Attach(H_bitmap);
<span style="white-space:pre"> </span>C_Bitmap.GetBitmap(&bitmap);
<span style="white-space:pre"> </span>CDC bmpDC;
<span style="white-space:pre"> </span>bmpDC.CreateCompatibleDC(pDC);
<span style="white-space:pre"> </span>bmpDC.SelectObject(&C_Bitmap);
<span style="white-space:pre"> </span>pDC->BitBlt(0, 0, bitmap.bmWidth, bitmap.bmHeight, &bmpDC, 0, 0, SRCCOPY);