lundi 21 avril 2014

c# - puis-je augmenter la résolution/DPI d'un Windows Form ? (certains moyens pour intensifier les contrôles) ? -Débordement de pile


I am developing a Windows Forms application in C# for use in an office. Thus far, with Anchoring and Autosizing, the controls lay themselves out well at the default form size, when maximized, etc.


The form does not look good in a conference room, on a large projected screen. Text is too small to be read easily.


We run Windows 7 on our machines, so as an experiment I raised the Display rendering from 100% to 150%. This made the text on the controls blurry, so I did some research and then added this to my Main() method.


[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware;

This worked really well - the app scaled up, the controls were large and readable, and everything continued to lay out well. The only problem is that changing the Display rendering forces you to log out, it inconvenient, and realistically our users will never do it. The computers are likely to stay at 100%.


Can I do this from within the application? I've seen a lot of questions about forcing an app down to 96 DPI, but is it possible to force it UP to 120 or 144 DPI?


Or maybe there is a different and better means to achieve the same goal? I would like to avoid building a separate "Presentation Mode" interface with large fonts if at all possible.



I am developing a Windows Forms application in C# for use in an office. Thus far, with Anchoring and Autosizing, the controls lay themselves out well at the default form size, when maximized, etc.


The form does not look good in a conference room, on a large projected screen. Text is too small to be read easily.


We run Windows 7 on our machines, so as an experiment I raised the Display rendering from 100% to 150%. This made the text on the controls blurry, so I did some research and then added this to my Main() method.


[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware;

This worked really well - the app scaled up, the controls were large and readable, and everything continued to lay out well. The only problem is that changing the Display rendering forces you to log out, it inconvenient, and realistically our users will never do it. The computers are likely to stay at 100%.


Can I do this from within the application? I've seen a lot of questions about forcing an app down to 96 DPI, but is it possible to force it UP to 120 or 144 DPI?


Or maybe there is a different and better means to achieve the same goal? I would like to avoid building a separate "Presentation Mode" interface with large fonts if at all possible.


0 commentaires:

Enregistrer un commentaire