System.Drawing.Graphics.DrawClosedCurve C# (CSharp) Method

DrawClosedCurve() public method

public DrawClosedCurve ( Pen pen, Point points ) : void
pen Pen
points Point
return void
        public void DrawClosedCurve(Pen pen, Point [] points)
        {
            if (pen == null)
                throw new ArgumentNullException ("pen");
            if (points == null)
                throw new ArgumentNullException ("points");

            DrawClosedCurve (pen, ConvertPoints (points), 0.5f, FillMode.Winding);
        }

Same methods

Graphics::DrawClosedCurve ( Pen pen, Point points, float tension, FillMode fillmode ) : void
Graphics::DrawClosedCurve ( Pen pen, PointF points ) : void
Graphics::DrawClosedCurve ( Pen pen, PointF points, float tension, FillMode fillmode ) : void

Usage Example

Example #1
0
        /// <summary>
        /// Draws the shape.
        /// </summary>
        /// <param name="G">The g.</param>
        /// <param name="FillShape">The fill shape.</param>
        /// <param name="DrawShape">The draw shape.</param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// FillModes - null
        /// or
        /// FillModes - null
        /// or
        /// ShapeTypes - null
        /// </exception>
        public void DrawShape(System.Drawing.Graphics G, Brush FillShape, Pen DrawShape)
        {
            foreach (List <Point> points in Points)
            {
                switch (ShapeType)
                {
                case ShapeTypes.Polygon:
                    switch (FillMode)
                    {
                    case FillModes.Fill:
                        G.FillPolygon(FillShape, points.ToArray());
                        break;

                    case FillModes.Border:
                        G.DrawPolygon(DrawShape, points.ToArray());
                        break;

                    case FillModes.Both:
                        G.FillPolygon(FillShape, points.ToArray());
                        G.DrawPolygon(DrawShape, points.ToArray());
                        break;

                    default:
                        throw new ArgumentOutOfRangeException(nameof(FillModes), FillMode, null);
                    }

                    break;

                case ShapeTypes.Spline:
                    switch (FillMode)
                    {
                    case FillModes.Fill:
                        G.FillClosedCurve(FillShape, points.ToArray());
                        break;

                    case FillModes.Border:
                        G.DrawClosedCurve(DrawShape, points.ToArray());
                        break;

                    case FillModes.Both:
                        G.FillClosedCurve(FillShape, points.ToArray());
                        G.DrawClosedCurve(DrawShape, points.ToArray());
                        break;

                    default:
                        throw new ArgumentOutOfRangeException(nameof(FillModes), FillMode, null);
                    }

                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(ShapeTypes), ShapeType, null);
                }
            }
        }
All Usage Examples Of System.Drawing.Graphics::DrawClosedCurve