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
pathIPathThe centerline path to split.
strokeWidthfloatThe stroke width (pattern elements are multiples of this).
patternReadOnlySpan<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
pathIPathThe centerline path to split.
strokeWidthfloatThe stroke width (pattern elements are multiples of this).
patternReadOnlySpan<float>The dash pattern. Each element is a multiple of
strokeWidth.startOffboolWhether the first item in the pattern is off rather than on.
Returns
- IPath
A path containing the "on" dash segments.