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