Пример #1
0
        protected override void OnTouchUp(TouchEventArgs e)
        {
            Point p = e.Point;

            PointToClient(ref p);

            CalibrationManager.CalibrationPoints.TouchX[idx] = (short)p.X;
            CalibrationManager.CalibrationPoints.TouchY[idx] = (short)p.Y;

            idx++;

            if (idx == CalibrationManager.CalibrationPoints.Count)
            {
                // The last point has been reached.
                CalibrationManager.ApplyCalibrationPoints();
                CalibrationManager.SaveCalibrationPoints();

                block.Set();
                Parent.Children.Remove(this);
            }
            else
            {
                Invalidate();
            }
        }
Пример #2
0
        public void Show()
        {
            if (Background == null)
            {
                Background = new SolidColorBrush(Color.CornflowerBlue);
            }
            if (CrosshairPen == null)
            {
                CrosshairPen = new Pen(Color.Red, 1);
            }

            idx = 0;
            CalibrationManager.PrepareCalibrationPoints();
            CalibrationManager.StartCalibration();

            gm.Desktop.Children.Add(this);

            block = new ManualResetEvent(false);
            block.WaitOne();
        }