获取最大屏幕分辨率并更改分辨率 [英] Get Maximum Screen Resolution And Change Resolution

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

问题描述

有人可以通过使用C#、. NET(尤其是Windows应用程序)来帮助我获得显示器的最大屏幕分辨率.
我知道如何更改分辨率,但是我对获取高度x格式的最大值感兴趣,例如:1280 x 768
用户可能具有任何屏幕分辨率范围,但如何获得最大可能的屏幕分辨率,这可能因监视器而异.
为了更改分辨率,我提到了:http://bit.ly/dtZmQS,它工作得很好.

Can anybody help me in getting Maximum Screen Resolution of the monitor by using C#, .NET particularly for windows application.
I got to know how to change the resolution but i m interested in getting maximum values in format Height x With example : 1280 x 768
User might be having any screen resolution range but how to get MAXIMUM possible Screen Resolution which can differ from Monitor to Monitor.
For changing resolution i had referred : http://bit.ly/dtZmQS which worked very well.

推荐答案

看看
Take a look at this[^].

I find this site to be a little confusing, so in case it''s not just me. :)

If you scroll down to just below the code listing there is a screen shot of what the Form should look like. So first create a Form with:
2 Labels
2 ListBoxes - named listDevices (top one) listSettings (bottom one)
1 Button - named btnSet

then copy the code from the site and paste it to replace the code in Form1.cs.

Then hook-up the listDevices_SelectedIndexChanged event handler to listDevices and away you go.

You could obviously hook-up the btnSet event handler too, if you are feeling adventurous. :-D

Good luck! :)


我链接到的代码使您能够获得设备的所有可用分辨率(它们在listSettings中列出)
这些项目包含高度和宽度的分辨率.

您需要做的是,而不是将它们添加到ListBox中,是从每个图中提取数字,将它们与迄今为止找到的最大数字进行比较,如果它们较大,则将它们另存为最大数字,依此类推.

该代码旨在向您显示您想要做的事情是可能的.

如果它不能完全满足您的要求,我感到非常抱歉,但是如果您不能根据该代码推断出您的要求,那么编程可能不是您才能的正确选择.
The code that I linked to enables you to get all the available resolutions for the device (they are listed in listSettings)
These items contain the resolution in height and width.

What you need to do is rather than add them to a ListBox is extract the figures from each, compare them to the largest found so far and if they are bigger save them as the largest, and so on.

The code was intended to show you that what you want to do is possible.

I am dreadfully sorry if it doesn''t do precisely what you require but if you are not able to extrapolate from that code to your requirements then maybe programming is not the correct outlet for your talents.


您可以使用System.Windows.Forms.Screen.GetBounds()来获取总大小.

在此处链接 [
You can use System.Windows.Forms.Screen.GetBounds() to get total size.

Link Here[^] may help.


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

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