Example #1
0
 private Shape BuildShape(Segment seg, int colorId)
 {
     Shape shape = (Shape)Activator.CreateInstance(Parameters.ShapeType);
     double radio = Parameters.ColorRadio[colorId];
     Point c = seg.CenterPoint();
     double x = c.X * Parameters.XRate;
     double y = (this.CavHeight + Exp.MaxY * Parameters.YRate) / 2 - c.Y * Parameters.YRate;
     shape.Margin = new Thickness(x - radio, CavHeight - y - radio, 0, 0);
     shape.Fill = Parameters.ColorList[colorId];
     shape.Width = shape.Height = radio * 2;
     return shape;
 }