Path.Widen Method (Pen)

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

Replaces the path with the outline of its stroke drawn with the specified pen.

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

Syntax

C#
public void Widen(
	Pen pen
)

Parameters

pen

Type: Aurigma.GraphicsMill.Drawing.Pen

The pen. Its width, line join, line cap, miter limit, dash pattern, and dash offset are used.

Remarks

A subpath that ends with Close() is a closed outline, and its stroke is a ring. Any other subpath is an open line, and its ends get the line cap of the pen. The dash lengths are in path units.

Round corners and caps deviate from the true arc by at most 0.1. Curves are converted to polylines first.

Examples

C#
var path = new Path();
path.MoveTo(20, 120);
path.LineTo(55, 30);
path.LineTo(95, 120);
path.LineTo(130, 30);

var original = new Path(path);

var pen = new Pen(RgbColor.Black, 14f)
{
    LineJoin = LineJoin.Round,
    LineCap = LineCap.Round
};

// Replace the line with the outline of its stroke.
path.Widen(pen);

The original path and the widened path.

The original path and the widened path.

Exceptions

Exception Condition
System.ArgumentNullException The pen is null.
System.ArgumentOutOfRangeException The pen width is not greater than 0, or the miter limit is less than 1.

See Also

Reference

Manual