Screen size in .NET format.

Is there a way to find out if the text size is 125% of .NET / C #?

Settings are made from the control panel \ Appearance and Personalization \ Display ...

+4
source share
2 answers

I have not tried this myself.

This registry key in Windows before Windows 7:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ FontDPI: LogPixels

And this is on Windows 7:
HKEY_CURRENT_USER \ Control Panel \ Desktop: LogPixels

Everything according to this topic in the MSDN Forum

Here are some additional resources:
Creating a DPI-enabled application
C # Scaling UserControl content to fit Dpi / Font sizes for users
DPI Details

+3
source

I'm not sure, but maybe you can just get the Dpi settings and check if they are 96 or not:

using(Graphics g = this.CreateGraphics()) { MessageBox.Show(g.DpiX.ToString() + Environment.NewLine + g.DpiY.ToString()); } 

You may need to call SetProcessDPIAware first.

0
source

Source: https://habr.com/ru/post/1309980/


All Articles