Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Printing size -bmp-help needed!

Printing size -bmp-help needed!

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    radha vijay
    wrote on last edited by
    #1

    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); } }

    D A 2 Replies Last reply
    0
    • R radha vijay

      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); } }

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • R radha vijay

        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); } }

        A Offline
        A Offline
        Alex Dolpfin
        wrote on last edited by
        #3

        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(...)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups