Get and Set Screen Resolution

后端 未结 6 1651
灰色年华
灰色年华 2020-11-27 18:07

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

6条回答
  •  旧巷少年郎
    2020-11-27 18:30

    in Winforms, there is a Screen class you can use to get data about screen dimensions and color depth for all displays connected to the computer. Here's the docs page: http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx

    CHANGING the screen resolution is trickier. There is a Resolution third party class that wraps the native code you'd otherwise hook into. Use its CResolution nested class to set the screen resolution to a new height and width; but understand that doing this will only work for height/width combinations the display actually supports (800x600, 1024x768, etc, not 817x435).

提交回复
热议问题