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(); } }
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(); }