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. device coordinates transformation

device coordinates transformation

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

    Hello, I want to TextOut values on a bitmap, but coordinates for one view does not corespond to coordinates on other views and resolutions. What can I do ? For example pDC->TextOut(100,100,myvalue) -> 100,100 is good just for one view and that's the one I start with. I tried some formulas of conversion but still my application depends on the starting resolution. If the computer I launch my application on doesn't have the same resolution as the one I made my app on then I'm screwed. All I want is to match the values I take from a file with cities on the map. The DrawText() method can't be given values that I want and I wasn't able to find any class the helps with that. Can anyone help me ? I'm really out of ideas.:confused: :confused: :confused:

    P D 2 Replies Last reply
    0
    • B BlackRider

      Hello, I want to TextOut values on a bitmap, but coordinates for one view does not corespond to coordinates on other views and resolutions. What can I do ? For example pDC->TextOut(100,100,myvalue) -> 100,100 is good just for one view and that's the one I start with. I tried some formulas of conversion but still my application depends on the starting resolution. If the computer I launch my application on doesn't have the same resolution as the one I made my app on then I'm screwed. All I want is to match the values I take from a file with cities on the map. The DrawText() method can't be given values that I want and I wasn't able to find any class the helps with that. Can anyone help me ? I'm really out of ideas.:confused: :confused: :confused:

      P Offline
      P Offline
      Prem Kumar
      wrote on last edited by
      #2

      Use specific mapping mode. That should solve your problem as they are independant of the resolutions of a moniter. And then yuo can use the foll. fns DPtoHIMETRIC Converts device units into HIMETRIC units. DPtoLP Converts device units into logical units. HIMETRICtoDP Converts HIMETRIC units into device units. HIMETRICtoLP Converts HIMETRIC units into logical units. LPtoDP Converts logical units into device units. LPtoHIMETRIC Converts logical units into HIMETRIC units.

      1 Reply Last reply
      0
      • B BlackRider

        Hello, I want to TextOut values on a bitmap, but coordinates for one view does not corespond to coordinates on other views and resolutions. What can I do ? For example pDC->TextOut(100,100,myvalue) -> 100,100 is good just for one view and that's the one I start with. I tried some formulas of conversion but still my application depends on the starting resolution. If the computer I launch my application on doesn't have the same resolution as the one I made my app on then I'm screwed. All I want is to match the values I take from a file with cities on the map. The DrawText() method can't be given values that I want and I wasn't able to find any class the helps with that. Can anyone help me ? I'm really out of ideas.:confused: :confused: :confused:

        D Offline
        D Offline
        Dana Holt
        wrote on last edited by
        #3

        I am not completely sure what your problem is, but you can get the current size of a window/view by calling its GetClientRect() method, and if you need the current screen resolution take a look at ::GetSystemMetrics(). -- Dana Holt Xenos Software

        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