title | ms.date | helpviewer_keywords | ms.assetid | description | |||||
---|---|---|---|---|---|---|---|---|---|
How to: Flatten a Curved Path into a Line |
03/30/2017 |
|
e654b8de-25f4-4735-9208-42e4514a589c |
Learn how to flatten a curved path into a line by calling the Flatten method of a GraphicsPath object |
A xref:System.Drawing.Drawing2D.GraphicsPath object stores a sequence of lines and Bézier splines. You can add several types of curves (ellipses, arcs, cardinal splines) to a path, but each curve is converted to a Bézier spline before it is stored in the path. Flattening a path consists of converting each Bézier spline in the path to a sequence of straight lines. The following illustration shows a path before and after flattening.
- call the xref:System.Drawing.Drawing2D.GraphicsPath.Flatten%2A method of a xref:System.Drawing.Drawing2D.GraphicsPath object. The xref:System.Drawing.Drawing2D.GraphicsPath.Flatten%2A method receives a flatness argument that specifies the maximum distance between the flattened path and the original path.
- xref:System.Drawing.Drawing2D.GraphicsPath?displayProperty=nameWithType
- Lines, Curves, and Shapes
- Constructing and Drawing Paths