HDC hMemDc = CreateCompatibleDC(hdc);
HBITMAP hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TEST);
HBITMAP hOldBmp = (HBITMAP)SelectObject(hMemDc, hBmp);
BITMAP bm;
GetObject(hBmp, sizeof(bm), &bm);
BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hMemDc, 0, 0, SRCCOPY);
SelectObject(hMemDc, hOldBmp);
DeleteObject(hBmp);
DeleteDC(hMemDc);
复制代码