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 with GUI+

Printing with GUI+

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
6 Posts 2 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.
  • B Offline
    B Offline
    Burz
    wrote on last edited by
    #1

    I want to print bitmap on full page, so i wright: [code] void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo) { int cxPage = pDC->GetDeviceCaps(HORZRES); int cyPage = pDC->GetDeviceCaps(VERTRES); Graphics g(pDC->m_hDC); g.DrawImage(m_pBitmap, 0, 0, cxPage , cyPage ); } [/code] Thats ok in preview but not in printer. What transformations i need to do?

    R B 2 Replies Last reply
    0
    • B Burz

      I want to print bitmap on full page, so i wright: [code] void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo) { int cxPage = pDC->GetDeviceCaps(HORZRES); int cyPage = pDC->GetDeviceCaps(VERTRES); Graphics g(pDC->m_hDC); g.DrawImage(m_pBitmap, 0, 0, cxPage , cyPage ); } [/code] Thats ok in preview but not in printer. What transformations i need to do?

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      This is due to a printer DC and a screen DC having different levels of support. Take a look at my "Printing tips and tricks from the trenches" article in the printing section. It has a method to solve this problem. Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

      B 1 Reply Last reply
      0
      • R Roger Allen

        This is due to a printer DC and a screen DC having different levels of support. Take a look at my "Printing tips and tricks from the trenches" article in the printing section. It has a method to solve this problem. Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

        B Offline
        B Offline
        Burz
        wrote on last edited by
        #3

        I read that article, but it dont contain answer: What and how i need to transform to see preview and printing page in the same style, using GUI+ ...

        R 1 Reply Last reply
        0
        • B Burz

          I read that article, but it dont contain answer: What and how i need to transform to see preview and printing page in the same style, using GUI+ ...

          R Offline
          R Offline
          Roger Allen
          wrote on last edited by
          #4

          You need to make use of the procedure that changes a DDB to a DIB and use StretchDIBBits() to plot it. This command is much better supported by printer DC's. BitBlt usually fails miserably. Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

          B 1 Reply Last reply
          0
          • R Roger Allen

            You need to make use of the procedure that changes a DDB to a DIB and use StretchDIBBits() to plot it. This command is much better supported by printer DC's. BitBlt usually fails miserably. Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

            B Offline
            B Offline
            Burz
            wrote on last edited by
            #5

            I use GUI+, object Graphics and Bitmap. No BitBlt or StretchDIBBits!

            1 Reply Last reply
            0
            • B Burz

              I want to print bitmap on full page, so i wright: [code] void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo) { int cxPage = pDC->GetDeviceCaps(HORZRES); int cyPage = pDC->GetDeviceCaps(VERTRES); Graphics g(pDC->m_hDC); g.DrawImage(m_pBitmap, 0, 0, cxPage , cyPage ); } [/code] Thats ok in preview but not in printer. What transformations i need to do?

              B Offline
              B Offline
              Burz
              wrote on last edited by
              #6

              Here is answer if somebody whant in: void CtestView::OnPrint(CDC* pDC, CPrintInfo* pInfo) { int cxPage = pDC->GetDeviceCaps(HORZRES); int cyPage = pDC->GetDeviceCaps(VERTRES); Graphics g(pDC->m_hDC); g.SetPageUnit(UnitInch); g.DrawImage(m_pBitmap, 0, 0, cxPage/g.GetDpiX() , cyPage/g.GetDpiX() ); }

              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