获得LCD显示屏的原始分辨率 [英] get native resolution of LCD display
本文介绍了获得LCD显示屏的原始分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,是否可以获取连接到系统的LCD显示器的实际原始分辨率或分辨率比率?
例如:如果LCD显示器是4:3或16:9等,独立于Windows的分辨率
谢谢!
hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system?
Eg.: i''d want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows'' resolution
Thanks!
推荐答案
尝试以下代码,这是不同的简单:
Try the following code, this is vary simple:
private void GetCurrentScreenResolution()
{
int intDeskHeight = Screen.PrimaryScreen.Bounds.Height;
int intDeskWidth = Screen.PrimaryScreen.Bounds.Width;
MessageBox.Show("Your screen resolution is " + intDeskWidth + "x" + intDeskHeight);
}
注意:感谢Mika Wendelius,以上代码是根据您的建议实现的.
NOTE: Thanks to Mika Wendelius, the above code is implement from your suggestion.
您可以使用System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size
.
You could useSystem.Windows.Forms.Screen.PrimaryScreen.Bounds.Size
.
尝试使用WMI类Win32_DesktopMonitor.
Try to use WMI class Win32_DesktopMonitor.
这篇关于获得LCD显示屏的原始分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文