tags:

views:

221

answers:

1

Is it possible to set the DPI of an application programmatically or the DPI only possible to set through the system preference?

Note: My application's GUI is coded in MFC and .NET forms.

Update: After some research I have found no way of doing this so I have to agree with the only answer here; it cannot be done.

+1  A: 

Assuming that you are talking about the Windows system-wide setting that determines the ratio between the physical DPI setting (that depends on the physical screen + resolution), the simple answer is "you can't", at least, not on at the application level in a WinForms app.

What you can do, is add scaling code to your form, see this StackOverflow entry. Basically, set the AutoScaleMode to ScaleMode.Dpi. See the other entry for more info.

tijmenvdk
I'm trying to achieve the same effect the system-wide setting has but on my application only. In other words, I want to let windows auto-scale my application but I want the application to supply the DPI.
yngvedh