![]() ![]() I realise with GDI there are the DrawCurve and DrawBezier methods, but this article will delve a bit deeper into the generation of the smoothed polylines and it will show how to deal with more than just a fixed number of vertices (which is 4 in the case of DrawBezier) and how to tweak the 'smoothness'. ![]() When drawing these objects, there is often a need to smooth the vertices of a polyline. See figure below for a graphic explanation. A polygon is simply a polyline where the startpoint is connected to the endpoint or a closed polyline. In a polyline, the vertices are connected in the order they appear in the collection. In this article, I will consider a point as a single x,y pair or vertex or simply P a line as a pair of vertices with startpoint P1 and endpoint P2) a polyline as a collection of multiple vertices with P1 to P n where n > 2. These objects are known under a lot of different names: shapes, paths, areas, regions, etc. When working with map (GIS) or chart data, you will have objects in the shape of 2D points, lines, polylines and polygons. ![]() Note: The VB.NET code of this article has been ported to C# by xtos (Chris C) on GitHub, see PolylineSmoothCSharp, thanks Chris.
0 Comments
Leave a Reply. |