设置我的显示分辨率我的、分辨率

2023-09-07 10:20:31 作者:古城白衣少年殇

我是C#开发人员,我必须经常改变我的显示分辨率。

I'm a C# developer and I have to change my display resolution regularly.

有很多关于如何看当前的显示分辨率的例子: SystemInformation.PrimaryMonitorSize

There are plenty of examples on how to read the current display resolutions: SystemInformation.PrimaryMonitorSize

我发现 ChangeDisplaySettingsEx功能

时要做到这一点在C#中的唯一方法是使用 PInvoke的 ???

Is the only way to do this in C# is with PInvoke???

这似乎很奇怪,我认为这是很容易得到这些信息出来,但很难将其设置...

It seems odd to me that it is very easy to get this information out, but difficult to set it...

推荐答案

您将不得不作出的PInvoke调用ChangedisplaySetting。

You'll have to make a PInvoke call to ChangedisplaySetting.

下面是有一些示例code, HTTP链接:// WWW。 xtremedotnettalk.com/printthread.php?t=73184 。

Here's a link that has some sample code, http://www.xtremedotnettalk.com/printthread.php?t=73184.