C# OpenTK Windows应用程序屏幕大小?
我正在用OpenTK做一个小项目,我想得到主显示器的屏幕分辨率。我的应用程序是windows应用程序,我已尝试使用C# OpenTK Windows应用程序屏幕大小?,c#,visual-studio,opengl,opentk,C#,Visual Studio,Opengl,Opentk,我正在用OpenTK做一个小项目,我想得到主显示器的屏幕分辨率。我的应用程序是windows应用程序,我已尝试使用 width=Screen.PrimaryScreen.Bounds.width 但是名称“screen”在当前上下文中不存在。我已经包含了所需的using语句,是否有其他方法获得屏幕大小 尝试使用显示设备 int width = DisplayDevice.Default.Width; int height = DisplayDevice.Default.Height; 您是
width=Screen.PrimaryScreen.Bounds.width代码>
但是名称“screen”在当前上下文中不存在。
我已经包含了所需的using语句,是否有其他方法获得屏幕大小 尝试使用显示设备
int width = DisplayDevice.Default.Width;
int height = DisplayDevice.Default.Height;
您是否添加了对System.Windows.Forms
的引用?这就是定义屏幕的地方。