1

I am developing a kinect application using WPF. Now I need to get the actual desktop screen resolution so that I can scale the area to take screenshot for any laptops. I have tried PrimaryScreenWidth, PrimaryScreenHeight, FullScreenHeight, and all that, but none of them give me the ACTUAL resolution. For example, if I have 1920*1080, those above fields will give me some other values.

I was wondering how to get the actual desktop screen resolution from C# WPF?

wonea
  • 4,783
  • 17
  • 86
  • 139
夏幸楠
  • 11
  • 1
  • 2

1 Answers1

6

Just use this:

System.Windows.SystemParameters.PrimaryScreenWidth
System.Windows.SystemParameters.PrimaryScreenHeight

or this:

System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height
BladeMight
  • 2,670
  • 2
  • 21
  • 35