Kinect.ShowCase.ChangeResolution.ChangeScreenResolution C# (CSharp) Method

ChangeScreenResolution() public method

public ChangeScreenResolution ( int x, int y ) : void
x int
y int
return void
        public void ChangeScreenResolution(int x, int y)
        {
            var d = EnumModes(x, y);
            if (!d.HasValue)
            {
                throw new Exception("Resolution not found");
            }

            var dev = d.Value;

            if (dev.dmPelsWidth == _originalResolution.dmPelsWidth &&
                dev.dmPelsHeight == _originalResolution.dmPelsHeight)
            {
                //Resolution is the same, return
                return;
            }

            ChangeDisplaySettings(ref dev, 0);
        }

Usage Example

 public MainWindow()
 {
     _changeResolution = new ChangeResolution();
     _changeResolution.ChangeScreenResolution(1024, 768);
     InitializeComponent();
     InitBalls();
     InitAnimations();
     InitKinect();
 }
All Usage Examples Of Kinect.ShowCase.ChangeResolution::ChangeScreenResolution