Revit.SDK.Samples.ObjectViewer.CS.Sketch3D.DrawCurves C# (CSharp) Method

DrawCurves() private method

Draw curves
private DrawCurves ( Graphics graphics, List curves, Matrix transform, Pen pen ) : void
graphics System.Drawing.Graphics graphics handle
curves List curves to be drawn
transform Matrix transform between canvas and graphic data
pen System.Drawing.Pen pen to draw
return void
        private void DrawCurves(Graphics graphics, List<PointF[]> curves, Matrix transform, Pen pen)
        {
            foreach (PointF[] curve in curves)
            {
                GraphicsPath gPath = new GraphicsPath();
                if (curve.Length == 0)
                {
                    break;
                }
                if (curve.Length == 1)
                {
                    gPath.AddArc(new RectangleF(curve[0], new SizeF(0.5f, 0.5f)), 0.0f, (float)Math.PI);
                }
                else
                {
                    gPath.AddLines(curve);
                }
                gPath.Transform(transform);
                graphics.DrawPath(pen, gPath);
            }
        }