void ShowBitmap(HDC hdc,const char *srcpath) { HBITMAP hBitmap = (HBITMAP)::LoadImage(0, srcpath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); BITMAP Bitmap ; GetObject (hBitmap, sizeof (BITMAP), &Bitmap) ; int nWidth = Bitmap.bmWidth; int nHeight = Bitmap.bmHeight; HDC hMemDc = CreateCompatibleDC(hdc); HGDIOBJ hOB = SelectObject(hMemDc, hBitmap); BitBlt(hdc,0,0,nWidth,nHeight,hMemDc,0,0,SRCCOPY); SelectObject(hMemDc, hOB); DeleteObject(hBitmap); DeleteDC(hMemDc); }