System.Drawing.Drawing2D.GraphicsPath.AddClosedCurve C# (CSharp) Method

AddClosedCurve() public method

public AddClosedCurve ( Point points ) : void
points Point
return void
        public void AddClosedCurve(Point[] points)
        {
            if (points == null)
                throw new ArgumentNullException ("points");
            if (points.Length < 3)
                throw new ArgumentException ("number of points");

            AddClosedCurve (points.ToFloat (), 0.5f);
        }

Same methods

GraphicsPath::AddClosedCurve ( Point points, float tension ) : void
GraphicsPath::AddClosedCurve ( PointF points ) : void
GraphicsPath::AddClosedCurve ( PointF points, float tension ) : void

Usage Example

        public static bool IsPointInsideRegion(Bitmap bitmap, System.Drawing.Point P1, System.Drawing.Point P2, System.Drawing.Point P3, System.Drawing.Point P4, System.Drawing.Point Px)
        {
            try
            {
                Bitmap   bmp  = new Bitmap(bitmap.Size.Width, bitmap.Size.Height);
                Graphics grph = Graphics.FromImage(bmp);

                System.Drawing.Point[] pointsArray = { P1, P2, P3, P4 };

                System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();

                path.AddClosedCurve(pointsArray);

                Region pathRegion = new Region(path);

                if (pathRegion.IsVisible(Px, grph))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ex = new Exception("Error occurred while identifying if point lies inside the quadrilateral or not. " + ex.Message);
                throw ex;
            }
        }
All Usage Examples Of System.Drawing.Drawing2D.GraphicsPath::AddClosedCurve