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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Replace scaling with SetWorldTransform?

Replace scaling with SetWorldTransform?

Scheduled Pinned Locked Moved C / C++ / MFC
questionalgorithmslearning
3 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.
  • C Offline
    C Offline
    CodeBrain
    wrote on last edited by
    #1

    I have an application that prints the contents of the screen on a printer. The user has the option to select some scaling factors for the print out. (E.g. fit to page, etc...) I am using the same printing function, which draws in a DC for the screen output and for the printer output. On NT, 2000 and XP am using the SetWorldTransform function before painting to the printer DC in order to scale the output. This works fine. But since SetWorldTransform does not work on 95/98 or ME, I am searching for a replacement of the SetWorldTransform function. Of course I only need the scaling ability of the SetWorldTransform function with constant factors for x an y. I am painting in the MM_TEXT mode so I thought that I could use the MM_ISOTROPIC instead to scale the viewport extends. So I need the same features (coordinate directions, origin) like in MM_TEXT mode but with scaled viewport extends!? How can I do that (SetWindowExt, SetViewportExt,...)? I already tried some things but without any results. Thanks in advance.

    B 1 Reply Last reply
    0
    • C CodeBrain

      I have an application that prints the contents of the screen on a printer. The user has the option to select some scaling factors for the print out. (E.g. fit to page, etc...) I am using the same printing function, which draws in a DC for the screen output and for the printer output. On NT, 2000 and XP am using the SetWorldTransform function before painting to the printer DC in order to scale the output. This works fine. But since SetWorldTransform does not work on 95/98 or ME, I am searching for a replacement of the SetWorldTransform function. Of course I only need the scaling ability of the SetWorldTransform function with constant factors for x an y. I am painting in the MM_TEXT mode so I thought that I could use the MM_ISOTROPIC instead to scale the viewport extends. So I need the same features (coordinate directions, origin) like in MM_TEXT mode but with scaled viewport extends!? How can I do that (SetWindowExt, SetViewportExt,...)? I already tried some things but without any results. Thanks in advance.

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      In a past project, I used MM_TEXT for screen drawing and MM_ANISOTROPIC for scaled printer output. Worked fine.  onwards and upwards...

      C 1 Reply Last reply
      0
      • B basementman

        In a past project, I used MM_TEXT for screen drawing and MM_ANISOTROPIC for scaled printer output. Worked fine.  onwards and upwards...

        C Offline
        C Offline
        CodeBrain
        wrote on last edited by
        #3

        Yes, I think that is a good way to do it. I have found a good article about the mapping topic. http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnargdi/html/msdn_mapping.asp The description is more detailed then in the API/MFC documentation.

        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