August 11th, 1999, 01:19 PM
Hi,
I have a BIG problem with my application and I don't know what to do. Can you PLEASE help me?
My program displays (CScrollView) one big bitmap (CBitmap) and some lines (LineTo) on it.
I have to add a print screen option, so I use:
HDC hDC;
DOCINFO di;
CRect myRect;
CPrintDialog dlgPrint(FALSE);
GetWindowRect(&myRect);
if (dlgPrint.DoModal() == IDOK)
{
hDC = dlgPrint.GetPrinterDC();
memset(&di, 0, sizeof( DOCINFO ) );
di.cbSize = sizeof( DOCINFO );
di.lpszDocName = "Dyread";
StartDoc( hDC, &di );
StartPage( hDC );
int printer_w = GetDeviceCaps(hDC,VERTRES);
int printer_h = GetDeviceCaps(hDC,HORZRES);
//print the bitmap
StretchBlt(hDC,0, 0, printer_w, printer_h, GetDC()->GetSafeHdc(),
0, 0, myRect.Width(),myRect.Height(), SRCCOPY);
CDrawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//print the lines
.....
EndPage( hDC );
EndDoc( hDC );
DeleteDC( hDC );
}
The problem is that I use MM_TEXT map mode, so the pixels on my screen and the dots on the printer are different sizes.
The bitmap looks terrible (StretchBlt)!
I tried to use MM_LOENGLISH but then the bitmap doesn't appear
Can you PLEASE help me?
Thanks
C.J.
I have a BIG problem with my application and I don't know what to do. Can you PLEASE help me?
My program displays (CScrollView) one big bitmap (CBitmap) and some lines (LineTo) on it.
I have to add a print screen option, so I use:
HDC hDC;
DOCINFO di;
CRect myRect;
CPrintDialog dlgPrint(FALSE);
GetWindowRect(&myRect);
if (dlgPrint.DoModal() == IDOK)
{
hDC = dlgPrint.GetPrinterDC();
memset(&di, 0, sizeof( DOCINFO ) );
di.cbSize = sizeof( DOCINFO );
di.lpszDocName = "Dyread";
StartDoc( hDC, &di );
StartPage( hDC );
int printer_w = GetDeviceCaps(hDC,VERTRES);
int printer_h = GetDeviceCaps(hDC,HORZRES);
//print the bitmap
StretchBlt(hDC,0, 0, printer_w, printer_h, GetDC()->GetSafeHdc(),
0, 0, myRect.Width(),myRect.Height(), SRCCOPY);
CDrawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//print the lines
.....
EndPage( hDC );
EndDoc( hDC );
DeleteDC( hDC );
}
The problem is that I use MM_TEXT map mode, so the pixels on my screen and the dots on the printer are different sizes.
The bitmap looks terrible (StretchBlt)!
I tried to use MM_LOENGLISH but then the bitmap doesn't appear
Can you PLEASE help me?
Thanks
C.J.