
Print preview doesn't work, but print ok
Hi all!
I don't understand. I try to implement print/print preview into my MDI
app. I'm able to print correctly what I see on screen, but unable to
print preview.
I set my CDC like that in the PrepareDC function:
pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetWindowExt(windowExt.Width(), windowExt.Height());
pDC->SetViewportExt(rc.Width(), -rc.Height());
pDC->SetViewportOrg(0, rc.Height());
I draw into a memory DC created this way:
pMemDC = new CDC();
pMemDC->CreateCompatibleDC(pDC);
memBitmap.CreateCompatibleBitmap(pDC, bitmapWidth, bitmapHeight);
pMemDC->SelectObject(&memBitmap);
brush.CreateSolidBrush(RGB(255,255,255));
pMemDC->SelectObject(&brush); // Select the brush
pMemDC->ExtFloodFill(0, 0, 0x00, FLOODFILLSURFACE);
and into the OnDraw function, I do a bitblt like that:
pDC->BitBlt(mScrollRect.left, mScrollRect.bottom, mScrollRect.Width(),
abs(mScrollRect.Height()), pMemDC, mScrollRect.left,
mScrollRect.bottom, SRCCOPY);
Any help would be appreciate!
Mathieu