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. Pinting in MFC, what is the best way.

Pinting in MFC, what is the best way.

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++career
4 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.
  • I Offline
    I Offline
    inlandchris
    wrote on last edited by
    #1

    Hi all, What is the best way to print inside MFC (Visual 2002). I have tried TextOut but that sucks because every printer is different. I am getting the idea that MFC can't do a very good job of printer because of limited functions? hopefully, its my limited knowledge.

    J 1 Reply Last reply
    0
    • I inlandchris

      Hi all, What is the best way to print inside MFC (Visual 2002). I have tried TextOut but that sucks because every printer is different. I am getting the idea that MFC can't do a very good job of printer because of limited functions? hopefully, its my limited knowledge.

      J Offline
      J Offline
      Johan Rosengren
      wrote on last edited by
      #2

      I'm sad to say that it is your limited knowledge :-) With GetDeviceCaps, you can get the resolution for the output media (be it screen or printer). You can use the value - compared with that of the screen - to scale your drawing and font creation. For text only, you can also create fonts in typographical points - CreatePointFont and CreatePointFontIndirect. Finally, you might want to set the mapping mode to one of the physical coordinate systems - see SetMapMode on MSDN.

      I 1 Reply Last reply
      0
      • J Johan Rosengren

        I'm sad to say that it is your limited knowledge :-) With GetDeviceCaps, you can get the resolution for the output media (be it screen or printer). You can use the value - compared with that of the screen - to scale your drawing and font creation. For text only, you can also create fonts in typographical points - CreatePointFont and CreatePointFontIndirect. Finally, you might want to set the mapping mode to one of the physical coordinate systems - see SetMapMode on MSDN.

        I Offline
        I Offline
        inlandchris
        wrote on last edited by
        #3

        Hi Johan, Thank you for the support. I will be working on this problem this weekend. Sadly, printing is my weakest skills but this project will force me to be better. I guess I have put off printing long enough. Thnx again.

        J 1 Reply Last reply
        0
        • I inlandchris

          Hi Johan, Thank you for the support. I will be working on this problem this weekend. Sadly, printing is my weakest skills but this project will force me to be better. I guess I have put off printing long enough. Thnx again.

          J Offline
          J Offline
          Johan Rosengren
          wrote on last edited by
          #4

          It's not much different from working with the screen, actually. The big problem is designing drawing code that makes no assumptions regarding the output resolution.

          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