我正在尝试使用Screen.PrimaryScreen.Bounds
获得当前的屏幕分辨率。我的屏幕分辨率为1920 X 1080当前,其比例为125%。
我使用了DPI设置(Screen.PrimaryScreen.Bounds.Height * (int)myForm.CreateGraphics().DpiY) / 96
和Screen.FromControl(myForm).WorkingArea.Height
,但是它返回的值是Screen.PrimaryScreen.Bounds
。如何获得1980 X 1920的值或屏幕比例的125%?我认为这两种方法都是有效的。
答案 0 :(得分:-1)
foreach (var screen in System.Windows.Forms.Screen.AllScreens)
{
Console.WriteLine("Device Name: " + screen.DeviceName);
Console.WriteLine("Bounds: " +
screen.Bounds.ToString());
Console.WriteLine("Type: " +
screen.GetType().ToString());
Console.WriteLine("Working Area: " +
screen.WorkingArea.ToString());
Console.WriteLine("Primary Screen: " +
screen.Primary.ToString());
}