コード例 #1
0
        public CalibrationWpf(Screen current)
        {
            InitializeComponent();
            screen = current;

            // Create the calibration target
            calibrationPointWpf = new CalibrationPointWpf(new Size(screen.Bounds.Width, screen.Bounds.Height));
            CalibrationCanvas.Children.Add(calibrationPointWpf);

            Opacity = 0;
            IsAborted = false;

            // Create the animation-out object and close form when completed
            animateOut = new DoubleAnimation(0, TimeSpan.FromSeconds(FADE_OUT_TIME))
            {
                From = 1.0,
                To = 0.0,
                AutoReverse = false
            };

            animateOut.Completed += delegate
            {
                Close();
            };
        }
コード例 #2
0
        public CalibrationWpf(Screen current)
        {
            InitializeComponent();
            screen = current;

            // Create the calibration target
            calibrationPointWpf = new CalibrationPointWpf(new Size(screen.Bounds.Width, screen.Bounds.Height));
            CalibrationCanvas.Children.Add(calibrationPointWpf);

            Opacity   = 0;
            IsAborted = false;

            // Create the animation-out object and close form when completet
            animateOut = new DoubleAnimation(0, TimeSpan.FromSeconds(FADE_OUT_TIME))
            {
                From        = 1.0,
                To          = 0.0,
                AutoReverse = false
            };

            animateOut.Completed += delegate
            {
                Close();
            };
        }
コード例 #3
0
        public CalibrationRunner(Screen screen, Size calibrationAreaSize, int pointCount)
        {
            this.screen = screen;
            this.calibrationAreaSize = calibrationAreaSize;
            this.count = pointCount;

            InitializeComponent();

            GazeManager.Instance.AddTrackerStateListener(this);

            // Test whether the tracker state allows for a calibration
            OnTrackerStateChanged(GazeManager.Instance.Trackerstate);

            // Create the calibration target
            double width_dpi  = Math.Round(Utility.Instance.ScaleDpi * screen.Bounds.Width, 0);
            double height_dpi = Math.Round(Utility.Instance.ScaleDpi * screen.Bounds.Height, 0);

            calPointWpf = new CalibrationPointWpf(new WndSize(width_dpi, height_dpi));
            CalibrationCanvas.Children.Add(calPointWpf);
            Canvas.SetLeft(calPointWpf, width_dpi / 2);
            Canvas.SetTop(calPointWpf, height_dpi / 2);

            // Set the properties of the CalibrationWindow
            BackgroundColor    = new SolidColorBrush(Colors.DarkGray);
            PointColor         = new SolidColorBrush(Colors.White);
            PointRecordingTime = sampleTimeMs;

            Opacity = 0;

            // Create the animation-out object and close form when completed
            animateOut = new DoubleAnimation(0, TimeSpan.FromSeconds(FADE_OUT_TIME))
            {
                From        = 1.0,
                To          = 0.0,
                AutoReverse = false
            };

            animateOut.Completed += delegate { Close(); };

            this.Cursor = System.Windows.Input.Cursors.None;
        }