Path.Flatten Method

Applies to: Graphics Mill 12.1, 6.x-12.x (may differ)

Replaces the curves of the path with polylines.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void Flatten(
	float tolerance
)

Parameters

tolerance

Type: System.Single

The largest allowed deviation of a polyline from the curve, in path units. Must be greater than 0.

Examples

C#
var path = new Path();
path.MoveTo(15, 120);
path.CurveTo(new System.Drawing.PointF(40, -20), new System.Drawing.PointF(110, 170), new System.Drawing.PointF(135, 30));

var original = new Path(path);

// Replace the curve with a polyline that deviates from it by at most 2 units.
path.Flatten(2f);

The original path and the flattened path.

The original path and the flattened path.

Exceptions

Exception Condition
System.ArgumentOutOfRangeException The tolerance is not greater than 0.

See Also

Reference

Manual