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

问题描述

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

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

推荐答案

对于检索屏幕分辨率,你会想使用类。在<$c$c>Screen.AllScreens属性可以用来访问系统上的所有显示的集合,也可以使用属性来访问主显示器。

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.

屏幕类有一个属性<$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;

对于更改的决议,事情变得更加复杂。 (或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.

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

05-27 13:59
查看更多