I'm trying to get every screen resolution (ex : 1920x1080) and zoom factor (ex : 125% or 120 dpi), without needing to move the application from screen to screen.
I've tried a lot of class/methods, but none gave me the correct result for my setup (Windows 10, primary screen is 1920x1080 zoom 125% and secondary screen (on the right) is 1920x1080 zoom 100%).
System.Windows.Forms.Screen
gives those results :
- 1920x1080 resolution for 1st screen (ok)
- 2400x1350 resolution for 2nd screen (not ok, should be 1920x1080)
Same results with http://www.wpftutorial.net/ScreenResolutions.html
With PInvoke, shcore.dll
's GetDpiForMonitor()
gives those results :
- 120 for 1st screen (ok)
- 120 for 2nd screen (not ok, should be 96)
Do you have any idea how I can do that and have correct results?