-
Notifications
You must be signed in to change notification settings - Fork 22
Different DPI on Windows 10 causes screen capture overlay to display incorrectly #17
Comments
I spent a few hours on this and could not figure out. Problem is setting capture window as topmost dialog for multiple windows at the same time. You cannot have multiple modal dialogs at the same time. So it has to be one form, which is correctly stretched to accommodate full desktop, accounting for different DPI, I'm not sure how to accomplish this. Tagged ticket with "help wanted". Greenshot somehow does it, so might need to spend more time looking into their source (it's also open source .NET code). Upvote if you think it's important. Personally I run all my monitors with the same DPI setting. They all (4) have the same size (24'') and orientation (landscape) - easier to work with. |
Sorry to bump an old thread but I do have some food for though here. It seems from looking at your source that you did not declare your program to be per-monitor DPI aware and just used the If you always reason in pixels, then your program should declare itself as per monitor DPI aware. I would recommend not to mess up with those functions but rather to add the following lines in your .manifest file.
This is what Microsoft recommends. Also once your program is declared as fully DPI-aware, you will be able to use the GetDpiForWindow and GetDpiForMonitor and they will no more lye to you. |
@RamonUnch That's an interesting idea. Unfortunately, per-monitor DPI aware behavior requires at least .NET 4.6.2, according to this answer. This project is based on .NET 4.0 for wider compatibility between Windows version. It can even run on Windows XP! Another point - I am not using WPF, which is what most examples are using, for instance: |
You can always change the .manifest file with a resource editor once your project is compiled. there is no reasons .NET version would matter. The manifest file is just a resource attached to your exe completely language neutral. It would remain XP compatible no problems. You can also on newer Winodw force the DPI awareness for any program in the compatibility property sheet of the program/shortcut. |
Well sorry, I did not think properly but you are right because .NET has his own procedures to draw controls, So this one might not be DPI aware and the program might have problems if you force per monitor DPI awareness. This could still be tried though. |
I'll think about it, thanks. |
On Windows 10 if each monitor is using different DPI, screen capture window takes portion of the screen (limitation of existing design, will need to rework so that each monitor is covered by its own screen capture dialog).
The text was updated successfully, but these errors were encountered: