HDC hdcScreen = GetDC(NULL);
HDC hdcWindow = GetDC(mWin);
HDC hdcMem = CreateCompatibleDC(hdcScreen);
if (!hdcScreen || !hdcWindow || !hdcMem){
MessageBox(NULL, "could not locate hdc's", "Viewer", MB_ICONERROR);
}
if (!StretchBlt(hdcMem, 0, 0, 300, 300, hdcScreen, 0, 0, 300, 300, SRCCOPY)){
MessageBox(NULL, "stretchblt failed", "Viewer", MB_ICONERROR);
}
else if (!BitBlt(hdcWindow, 0, 0, 300, 300, hdcMem, 0, 0, SRCCOPY)){
// error
MessageBox(NULL, "stretchblt failed", "Viewer", MB_ICONERROR);
}
ReleaseDC(NULL, hdcScreen);
ReleaseDC(mWin, hdcWindow);
ReleaseDC(mWin, hdcMem);
A single call to StretchBlt from Screen to Window works fine, but the above does not. Any helpful tips?
[Edit] No errors are triggered, so everything seems to work fine, however the window associated with mWin is blank.