Example #1
0
 void drawhost_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (points == null)
     {
         drawhost.MouseMove += new System.Windows.Input.MouseEventHandler(drawhost_MouseMove);
         drawhost.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(drawhost_MouseLeftButtonUp);
         points = new List<Point>();
         points.Add(e.GetPosition(drawhost));
         points.Add(e.GetPosition(drawhost));
         Brush br = Brushes.LightGreen;
         area = new AreaVisual(pen);
         drawhost.Add(area);
         area.Points = points;
         points_toget = points;
         area.Redraw();
     }
 }