Printing size -bmp-help needed!
-
Hi I am trying to print bmp/jpeg image from an mfc application, but the image size is very small. Can someone tell me how to get the original size while printing? Here is my code. Thankyou. BOOL CView::OnPreparePrinting ( CPrintInfo *info ) { info -> SetMaxPage ( 1 ) ; return DoPreparePrinting ( info ) ; } void CView::OnPrepareDC ( CDC *pDC, CPrintInfo* info ) { CView::OnPrepareDC ( pDC, info ) ; if ( pDC -> IsPrinting( ) ) int n = info -> m_nCurPage ; pDC->SetMapMode(MM_ANISOTROPIC); pDC->SetWindowExt(10000,10000); pDC->SetViewportExt(18000,18000); pDC->SetViewportOrg(500,1000); } }
-
Hi I am trying to print bmp/jpeg image from an mfc application, but the image size is very small. Can someone tell me how to get the original size while printing? Here is my code. Thankyou. BOOL CView::OnPreparePrinting ( CPrintInfo *info ) { info -> SetMaxPage ( 1 ) ; return DoPreparePrinting ( info ) ; } void CView::OnPrepareDC ( CDC *pDC, CPrintInfo* info ) { CView::OnPrepareDC ( pDC, info ) ; if ( pDC -> IsPrinting( ) ) int n = info -> m_nCurPage ; pDC->SetMapMode(MM_ANISOTROPIC); pDC->SetWindowExt(10000,10000); pDC->SetViewportExt(18000,18000); pDC->SetViewportOrg(500,1000); } }
The document should have information on the bitmap, since it had to load it from a file, or create it outright.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
Hi I am trying to print bmp/jpeg image from an mfc application, but the image size is very small. Can someone tell me how to get the original size while printing? Here is my code. Thankyou. BOOL CView::OnPreparePrinting ( CPrintInfo *info ) { info -> SetMaxPage ( 1 ) ; return DoPreparePrinting ( info ) ; } void CView::OnPrepareDC ( CDC *pDC, CPrintInfo* info ) { CView::OnPrepareDC ( pDC, info ) ; if ( pDC -> IsPrinting( ) ) int n = info -> m_nCurPage ; pDC->SetMapMode(MM_ANISOTROPIC); pDC->SetWindowExt(10000,10000); pDC->SetViewportExt(18000,18000); pDC->SetViewportOrg(500,1000); } }
After creating a printer DC in your printing function calculate desired destination rectangle taking into account a size of paper: CSize paper_res; paper_res.cx = dcPrinter.GetDeviceCaps(HORZRES); paper_res.cy = dcPrinter.GetDeviceCaps(VERTRES); Try to set dcPrinter's map mode as MM_TEXT and to use dcPrinter.StrechBlt(...)