Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application level Monitor Configuration : DPI per monitor #306

Open
gnanamu opened this issue Aug 11, 2020 · 0 comments
Open

Application level Monitor Configuration : DPI per monitor #306

gnanamu opened this issue Aug 11, 2020 · 0 comments

Comments

@gnanamu
Copy link

gnanamu commented Aug 11, 2020

Application level Monitor Configuration : DPI per monitor

I am working on a medical application where we have maximum 3 top level windows. All the 3 windows has to be showed in full screen over the task bar. Windows will be in frame-less and will show custom title bar at the top. Windows location and size are auto-detected by application and user do not have control over it.

Application Basic flow:
When application is launched only primary window (full-screen)will be displayed with login page. Once user logins logins, he can see patients list. When user opens any patient data, primary window will be hidden and patient data will be opened in 2nd and 3rd window respectively(both full screen). 2nd window replaces the primary window which was hidden and 3rd window will be displayed in new monitor.

Currently we are trying to implement special configuration to choose 2 monitors from system where our top level windows will display.
e.g If a system is having 5 monitors connected (some hospitals reading rooms have) user can choose 2 monitors from 5. Say user is choosing 3 and 4 as monitors for our application. Our application should display 1st and 2nd windows(exclusive) on monitor3 and 3rd window in monitor4.

Problem:
I am using System.Windows.Forms.Screen.AllScreens to get screen coordinates. Since we enabled perMonitor configuration in app.manifest we get physical coordinates of the monitors. This is working only for monitors all set to 100% dpi. When any of the monitor dpi changes wpf again apply a scaling and windows are clipping this monitors. Means we cannot get the coordinates working.

When I remove all the dpiaware setting in manifest, OS automatically scales the window but windows are blurred that is not desirable for medical application where image quality will be at maximum expectation.

I tried this but not working.
PerMonitorDPI

Initially I tried this it seems to be working if I comment the Height and Width scaling in PerMonitorDPIWindow.OnLoad. But is was working only for .net4.5 . after I integrated to our application(.Net 4.7.2 ) newer .Net automatically again apply scaling.
PerMonitorDPIAware

Basically is need virtual coordinates of the monitors so that I can able to set the bounds (Top,Left ,Width,Height) can be set. Screen.AllScreen gives only physical coordinates. Please provide we a way how to get this working.

Thank you,
Gnanamurugan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant