【问题标题】:OpenTK Windows Application screen size?OpenTK Windows 应用程序屏幕大小?
【发布时间】:2017-02-20 02:01:42
【问题描述】:

我正在开发 OpenTK 中的一个小项目,我想获得主显示器的屏幕分辨率。我的应用是windows应用,我试过用
width = Screen.PrimaryScreen.Bounds.Width;
但是当前上下文中不存在名称“screen”。
我已经包含了所需的 using 语句,还有其他方法可以获取屏幕大小吗?

【问题讨论】:

  • 您是否添加了对System.Windows.Forms 的引用?这就是定义Screen 的地方。

标签: c# visual-studio opengl opentk


【解决方案1】:

尝试使用DisplayDevice

 int width = DisplayDevice.Default.Width;
 int height = DisplayDevice.Default.Height;

Source here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多