I downloaded the clipper library, which allows me to inflate a polygon (offset a polygon).
"boundary_Points" is the Point array containing all vertices of the polygon. Below is the code I'm using. Unfortunately, the command "DrawPolygons()", which is used in other web examples, doesn't exist as a function. Is there any way to access this command or another way to draw? The challenge is: Clipper library uses the type IntPoint, which cannot be used in GDI+, as far as I'm concerned. Thanks
using Path = List<IntPoint>;
using Paths = List<List<IntPoint>>;
boundary_path.AddLines(boundary_Points);
Region boundary_region = new Region(boundary_path);
g.DrawPath(pen1, boundary_path);
ClipperOffset co = new ClipperOffset();
Path boundary_point_list= new Path(); //contains all IntPoints of the polygon
co.AddPath(boundary_point_list, JoinType.jtRound, EndType.etClosedPolygon);
Paths solution = new Paths(); //
co.Execute(ref solution, -7.0);
DrawPolygons(solution, 0x40808080);
g.FillPolygon(Brushes.Olive, boundary_Points);
Clipper does not provide drawing methods out-of-the-box. You'd have to convert
IntPoint
to whatever format suitable for drawing manually by the drawing API that you'd like to use.I don't use C#, but here's what I do in my code in order to convert
IntPoint
to float-based type in C++:The result could then be passed to the drawing API, but again, it depends on what kind of library you use. I don't have experience with GDI+.