获取和设置屏幕分辨率 [英] Get and Set Screen Resolution

查看:303
本文介绍了获取和设置屏幕分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何收集和使用Visual C#改变屏幕分辨率?

How can I collect and change screen resolution using Visual C#?

推荐答案

对于检索屏幕分辨率,你会想使用<$c$c>System.Windows.Forms.Screen类。在<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.allscreens.aspx\"><$c$c>Screen.AllScreens属性可以用来访问系统上的所有显示的集合,也可以使用<$c$c>Screen.PrimaryScreen属性来访问主显示器。

For retrieving the screen resolution, you're going to want to use the System.Windows.Forms.Screen class. The Screen.AllScreens property can be used to access a collection of all of the displays on the system, or you can use the Screen.PrimaryScreen property to access the primary display.

屏幕类有一个属性<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.bounds.aspx\"><$c$c>Bounds,你可以用它来确定类的当前实例的分辨率。例如,要确定当前屏幕的分辨率:

The Screen class has a property called Bounds, which you can use to determine the resolution of the current instance of the class. For example, to determine the resolution of the current screen:

Rectangle resolution = Screen.PrimaryScreen.Bounds;

对于更改的决议,事情变得更加复杂。 本文(或<一个href=\"http://www.c-sharpcorner.com/UploadFile/Joshy_geo/changescreenresolution10102006112110AM/changescreenresolution.aspx\">this 之一)提供了详细的实施和解释。希望这有助于。

For changing the resolution, things get a little more complicated. This article (or this one) provides a detailed implementation and explanation. Hope this helps.

这篇关于获取和设置屏幕分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆