StretchBlt不支持对内存HDC的操作么 怎么实现不了,GetDeviceCaps怎么检测,是这样么?
北漂17载 2004-05-07 10:31:43 StretchBlt不支持对内存HDC的操作么 怎么实现不了,GetDeviceCaps怎么检测,是这样么?
代码:
HDC htempDC;
htempDC=CreateCompatibleDC(memoryDC);
SetMapMode(htempDC,GetMapMode(memoryDC));
BitBlt(htempDC,0,0,bm.bmWidth,bm.bmHeight,htempDC,0,0,SRCCOPY);
int result;
result=GetDeviceCaps(memoryDC,RASTERCAPS);
if((RC_STRETCHBLT|result)>0)
{
MessageBox(hWnd,"Support the stretchbilet ","eee",MB_OK);
}//bm.bmWidth
StretchBlt(memoryDC,0,0,bm.bmWidth ,bm.bmHeight,htempDC,-bm.bmWidth,0,
bm.bmWidth,bm.bmHeight,SRCCOPY);
//BitBlt(memoryDC,0,0,bm.bmWidth,bm.bmHeight,hdc,0,0,SRCCOPY);
BitBlt(hdc,0,0,bm.bmWidth,bm.bmHeight,memoryDC,0,0,SRCCOPY);
if(GetLastError()!=0)
{
MessageBox(hWnd,"eeror vertical ","eee",MB_OK);
}
DeleteObject(htempDC);
其中:
HBITMAP hbmp;
BITMAP bm;
HDC memoryDC;
在sdk下