public override void Draw(Graphics G, SubarrayProxy<PointF> Points, float Scale) { PointF T = new PointF(); var Bl = false; var Path = new GraphicsPath(); for (int i = 0; i < Points.Count; i++) { if (Bl) { Path.StartFigure(); Path.AddLine(Points[i], T); Path.CloseFigure(); } else T = Points[i]; Bl = !Bl; } G.DrawPath(this.Pen, Path); }
public abstract void Draw(Graphics G, SubarrayProxy<PointF> Points, Single Scale);
public override void Draw(Graphics G, SubarrayProxy<PointF> Points, float Scale) { var Path = new GraphicsPath(); var Sz = this.IndicatorsSize; var Sz2 = Sz * 2; switch (this.IndicatorsShape) { case ShapeOfIndicator.Square: for (int i = 0; i < Points.Count; i++) { var T = Points[i]; Path.AddRectangle(new RectangleF((Single)T.X - Sz, (Single)T.Y - Sz, Sz2, Sz2)); } break; case ShapeOfIndicator.Circle: for (int i = 0; i < Points.Count; i++) { var T = Points[i]; Path.AddEllipse(new RectangleF((Single)T.X - Sz, (Single)T.Y - Sz, Sz2, Sz2)); } break; case ShapeOfIndicator.SquareRotated: var D = Sz * (Single)Math.Sqrt(2); for (int i = 0; i < Points.Count; i++) { var T = Points[i]; Path.StartFigure(); Path.AddPolygon(new[] { new PointF(T.X - D, T.Y), new PointF(T.X, T.Y - D), new PointF(T.X + D, T.Y), new PointF(T.X, T.Y + D) }); Path.CloseFigure(); } break; case ShapeOfIndicator.Triangle: var H = 2 * Sz * (Single)Math.Cos(Math.PI / 6); var C = Sz * (Single)Math.Tan(Math.PI / 6); for (int i = 0; i < Points.Count; i++) { var T = Points[i]; var Y = T.Y + C; Path.StartFigure(); Path.AddPolygon(new[] { new PointF(T.X, Y - H), new PointF(T.X - Sz, Y), new PointF(T.X + Sz, Y) }); Path.CloseFigure(); } break; default: break; } G.DrawPath(this.Pen, Path); }