public void AddRange(IEnumerablepoints);
using System.Drawing; using System.Drawing.Drawing2D; // Create a polygon var polygon = new GraphicsPath(); // Define the points of the polygon as an array var points = new PointF[] { new PointF(10, 10), new PointF(50, 10), new PointF(20, 40), new PointF(40, 60), new PointF(10, 50) }; // Add the points to the polygon polygon.AddPolygon(points);
using System.Drawing; using System.Drawing.Drawing2D; // Create a GraphicsPath var path = new GraphicsPath(); // Define the points of the first polygon var points1 = new PointF[] { new PointF(10, 10), new PointF(50, 10), new PointF(20, 40), new PointF(40, 60), new PointF(10, 50) }; // Define the points of the second polygon var points2 = new PointF[] { new PointF(70, 10), new PointF(110, 10), new PointF(80, 40), new PointF(100, 60), new PointF(70, 50) }; // Add the polygons to the GraphicsPath path.AddPolygon(points1); path.AddPolygon(points2);Package/library: This is a built-in class of System.Drawing.Drawing2D namespace in C#. No external package or library is required.