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. Print Problem

Print Problem

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
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.
  • M Offline
    M Offline
    Md Mazharul Islam Khan
    wrote on last edited by
    #1

    I want to Print An Image Buffer(640*480) in MFC dialog application. I can print but, size of Printed Image is not (640*480). How can I solve the problem? Probably in mapping Problem. I used : void PMCToolDlg::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { if (pDC->IsPrinting()) { pDC->SetMapMode(MM_ISOTROPIC); pDC->SetViewportExt(7, 7); pDC->SetWindowExt(1, 1); pDC->SetViewportOrg(0,0); } } Thannks in Adance, Mazhar

    N M 2 Replies Last reply
    0
    • M Md Mazharul Islam Khan

      I want to Print An Image Buffer(640*480) in MFC dialog application. I can print but, size of Printed Image is not (640*480). How can I solve the problem? Probably in mapping Problem. I used : void PMCToolDlg::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { if (pDC->IsPrinting()) { pDC->SetMapMode(MM_ISOTROPIC); pDC->SetViewportExt(7, 7); pDC->SetWindowExt(1, 1); pDC->SetViewportOrg(0,0); } } Thannks in Adance, Mazhar

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      And where are you creating the compatible bitmap to the equivalent size of your dimensions in that mappin mode?

      Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)

      1 Reply Last reply
      0
      • M Md Mazharul Islam Khan

        I want to Print An Image Buffer(640*480) in MFC dialog application. I can print but, size of Printed Image is not (640*480). How can I solve the problem? Probably in mapping Problem. I used : void PMCToolDlg::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { if (pDC->IsPrinting()) { pDC->SetMapMode(MM_ISOTROPIC); pDC->SetViewportExt(7, 7); pDC->SetWindowExt(1, 1); pDC->SetViewportOrg(0,0); } } Thannks in Adance, Mazhar

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        I see one problem immediately... From the docs: "When MM_ISOTROPIC mode is set, an application must call the SetWindowExtEx function before calling SetViewportExtEx"

        mazhar_cse wrote:

        size of Printed Image is not (640*480).

        Assuming you get the DC set up properly, and you're not stretching the image when you render it to the print DC, the resulting image dimensions should be 4480 x 3360.  As far as the size on the printed page - this could be anything.  You haven't taken resolution into consideration here. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        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