我在SDK中实现屏幕站图,但是位图我是在基于对话框的程序中进行,为什么图像始终不显示?
case WM_LBUTTONDOWN:
{
// MessageBox(NULL,L"abcd",L"hehe",MB_OK);
hBmp=LoadBitmap(MyListhInst,MAKEINTRESOURCE(IDB_BITMAP1));
HDC hdctemp = NULL;
HBITMAP hbmptemp = NULL;
BITMAP bmp;
GetObject(hBmp,sizeof(bmp), &bmp);
hdc = GetDC(hWnd);
TextOut(hdc,0,0,L"美丽",2);
hdcmem = CreateCompatibleDC(hdc);
hdctemp = CreateCompatibleDC(hdc);
hbmptemp = CreateCompatibleBitmap(hdc,rectImage.right - rectImage.left, rectImage.bottom - rectImage.top);
SelectObject(hdctemp,hBmp);
SelectObject(hdcmem,hbmptemp);
bool pp=BitBlt(hdcmem,0,0,ThisOfRect.right- ThisOfRect.left,ThisOfRect.bottom- ThisOfRect.top,hdctemp,rectImage.left,rectImage.top,SRCCOPY);
/*TCHAR MyChar[200];
wsprintf(MyChar,L"textout-%d",pp);
MessageBox(hWnd,MyChar,L"提示",MB_OK);*/
ReleaseDC(hWnd,hdc);
DeleteDC(hdctemp);
DeleteObject(hbmptemp);
DeleteObject(hBmp);
}
我用TextOut字体能显示出来,但是就是图像不显示,为什么?