开发者

Changing Screen Resolution

I have a C# WPF application, I want it, when launched, to change the screen resolution if i开发者_JS百科t is not what it should work on, like the games.

I know how to retrieve the screen resolution, but I don`t know how to set it to what I want.

NOTE: I`m not working with ASP or WEB, just a desktop APP


This API function lets you change display settings:

        [DllImport("user32.dll")]
        static extern int ChangeDisplaySettings(
        ref DEVMODE devMode, int flags);

This article explains how to use this function


Why do you require this.

I think you should not do this, rather you can build the application within a ViewBox and which let you create Resolution Independent UI.

Please check my article : http://www.dotnetfunda.com/articles/article827-resolution-independent-ui-.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜