public MainWindow() { InitializeComponent(); GazeSource = GazeSourceFactory.Create(); GazeSource.UseCalibration = true; GazeSource.UseSmoothing = true; GazeSource.DataAvailable += GazeSource_DataAvailable; Timer = new DispatcherTimer(); Timer.Interval = GazeTimeMilliseconds; Timer.IsEnabled = false; Timer.Tick += Timer_Tick; }
private void StartCalibration() { System.Windows.Forms.Cursor.Hide(); DataPointIndex = 0; DataPoints = new List <System.Drawing.Point>(); GazeSource = GazeSourceFactory.Create(); GazeSource.UseCalibration = false; GazeSource.UseSmoothing = true; GazeTimer = new DispatcherTimer(); GazeTimer.Interval = TimeSpan.FromMilliseconds(1000 / 50); GazeTimer.Tick += GazeTimerTick; GazeTimer.Start(); TimeoutTimer = new DispatcherTimer(); TimeoutTimer.Interval = TimeSpan.FromSeconds(8); TimeoutTimer.Tick += TimeoutTimer_Tick; TimeoutTimer.Start(); ClearFocusPointLocation(); Canvas.SetLeft(FocusPoint, 0); Canvas.SetTop(FocusPoint, 0); }