/// <summary> /// Constructor /// </summary> public Screen(MainWindow parentMainWindow) { // Default values MouseMoveThreshold = 0.10f; MouseDownThreshold = 0.01f; MouseUpThreshold = 0.03f; DetectThreshold = 0.15f; BottomEdge = 0; RightEdge = 0; LeftEdge = 0; TopEdge = 0; ParentMainWindow = parentMainWindow; SetScreen(); if (LeftEdge <= 0 || RightEdge <= 0) { // Calibration may be required. notify the user MessageBoxResult result = MessageBox.Show("Detected screen dimensions may be incorrect. Please check the values!", "WARNING - Calibration May Be Required", MessageBoxButton.OK, MessageBoxImage.Warning); switch (result) { case MessageBoxResult.OK: // run code to force calibration? //ParentMainWindow.CalibrateClick(); // doesnt seem to work - to be fixed break; } ParentMainWindow.CalibrateClick(); } _screenMemento = new ScreenMemento(TopEdge, LeftEdge, RightEdge, BottomEdge); _calibratePoints = new CameraSpacePoint[TouchWallApp.KinectWidth * TouchWallApp.KinectHeight]; }
/// <summary> /// Sets up the calibration process by saving the current values of the screen in case the user decides to cancel later /// </summary> public void BeginCalibration() { TouchWallApp.CurrentGestureType = 1; TouchWallApp.CursorStatus = 0; _screenMemento = new ScreenMemento(TopEdge, LeftEdge, RightEdge, BottomEdge); if (TouchWallApp.CalibrateStatus == 0) { TouchWallApp.CalibrateStatus = 1; } }