Exemplo n.º 1
0
 public override MyGraphic Clone()
 {
     MyLine me = new MyLine(Left1, Top1, Left2, Top2);
     me.isVisible = this.isVisible;
     me.drawmode = this.drawmode;
     return me;
 }
Exemplo n.º 2
0
 //画线
 private void AddLine(Point pt1, Point pt2)
 {
     if (line != null)
     {
         canvas1.Children.Remove(line);
         line = null;
     }
     MyLine line1 = new MyLine();
     line1.Left1 = pt1.X;
     line1.Top1 = pt1.Y;
     line1.Left2 = pt2.X;
     line1.Top2 = pt2.Y;
     line1.drawmode = new GeometryMode(brush, pen);
     compositeGraphic.Add(line1, 0, 0);
     du_refresh();
     canvas1.ReleaseMouseCapture();
 }