Table of Contents

Class SplitPathExtensions

Namespace
SixLabors.ImageSharp.Drawing
Assembly
SixLabors.ImageSharp.Drawing.dll

Extensions to IPath for splitting paths into dash segments without performing stroke expansion.

public static class SplitPathExtensions
Inheritance
SplitPathExtensions
Inherited Members

Methods

GenerateDashes(IPath, float, ReadOnlySpan<float>)

Splits the given path into dash segments based on the provided pattern. Returns a composite path containing only the "on" segments as open sub-paths.

public static IPath GenerateDashes(this IPath path, float strokeWidth, ReadOnlySpan<float> pattern)

Parameters

path IPath

The centerline path to split.

strokeWidth float

The stroke width (pattern elements are multiples of this).

pattern ReadOnlySpan<float>

The dash pattern. Each element is a multiple of strokeWidth.

Returns

IPath

A path containing the "on" dash segments.

GenerateDashes(IPath, float, ReadOnlySpan<float>, bool)

Splits the given path into dash segments based on the provided pattern. Returns a composite path containing only the "on" segments as open sub-paths.

public static IPath GenerateDashes(this IPath path, float strokeWidth, ReadOnlySpan<float> pattern, bool startOff)

Parameters

path IPath

The centerline path to split.

strokeWidth float

The stroke width (pattern elements are multiples of this).

pattern ReadOnlySpan<float>

The dash pattern. Each element is a multiple of strokeWidth.

startOff bool

Whether the first item in the pattern is off rather than on.

Returns

IPath

A path containing the "on" dash segments.