示例#1
0
 private void _path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         if (EndPoints == null)
         {
             EndPoints = new List <ThumbPoint>();
         }
         var point  = e.GetPosition(_canvas);
         var tpoint = new ThumbPoint(point);
         tpoint.DragDelta     += Thumb_DragDelta;
         tpoint.DragCompleted += Item_DragCompleted;
         _canvas.Children.Add(tpoint);
         EndPoints.Add(tpoint);
         ControlPoints.Add(tpoint);
         OrderControlPoints();
     }
 }
示例#2
0
 private void _canvas_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         var point = e.GetPosition(_canvas);
         int n     = Points.Where(p => Math.Abs(p.X - point.X) < 2 && Math.Abs(p.Y - point.Y) < 2).Count();
         if (n > 0)
         {
             return;
         }
         var thumb = new ThumbPoint(point);
         thumb.DragDelta     += Thumb_DragDelta;
         thumb.DragCompleted += Item_DragCompleted;
         ControlPoints.Add(thumb);
         _canvas.Children.Add(thumb);
         OrderControlPoints();
         GetBezierApproximation();
     }
 }
示例#3
0
 public Tuple(int lapth, int rpath, ThumbPoint point)
 {
     LPath = lapth;
     RPath = rpath;
     Point = point;
 }