Class PathExtensions
Convenience methods that can be applied to shapes and paths.
Inherited Members
Namespace: SixLabors.ImageSharp.Drawing
Assembly: SixLabors.ImageSharp.Drawing.dll
Syntax
public static class PathExtensions
Methods
| Edit this page View SourceComputeLength(IPath)
Calculates the approximate length of the path as though each segment were unrolled into a line.
Declaration
public static float ComputeLength(this IPath path)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to compute the length for. |
Returns
Type | Description |
---|---|
float | The float representing the unrolled length. For closed paths, the length includes an implicit closing segment. |
Rotate(IPath, float)
Creates a path rotated by the specified radians around its center.
Declaration
public static IPath Rotate(this IPath path, float radians)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to rotate. |
float | radians | The radians to rotate the path. |
Returns
Type | Description |
---|---|
IPath | A IPath with a rotate transform applied. |
Rotate(IPathCollection, float)
Creates a path rotated by the specified radians around its center.
Declaration
public static IPathCollection Rotate(this IPathCollection path, float radians)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | path | The path to rotate. |
float | radians | The radians to rotate the path. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a rotate transform applied. |
RotateDegree(IPath, float)
Creates a path rotated by the specified degrees around its center.
Declaration
public static IPath RotateDegree(this IPath shape, float degree)
Parameters
Type | Name | Description |
---|---|---|
IPath | shape | The path to rotate. |
float | degree | The degree to rotate the path. |
Returns
Type | Description |
---|---|
IPath | A IPath with a rotate transform applied. |
RotateDegree(IPathCollection, float)
Creates a path rotated by the specified degrees around its center.
Declaration
public static IPathCollection RotateDegree(this IPathCollection shape, float degree)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | shape | The path to rotate. |
float | degree | The degree to rotate the path. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a rotate transform applied. |
Scale(IPath, float)
Creates a path translated by the supplied position
Declaration
public static IPath Scale(this IPath path, float scale)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to translate. |
float | scale | The amount to scale along both the x and y axis. |
Returns
Type | Description |
---|---|
IPath | A IPath with a translate transform applied. |
Scale(IPath, float, float)
Creates a path translated by the supplied position
Declaration
public static IPath Scale(this IPath path, float scaleX, float scaleY)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to translate. |
float | scaleX | The amount to scale along the X axis. |
float | scaleY | The amount to scale along the Y axis. |
Returns
Type | Description |
---|---|
IPath | A IPath with a translate transform applied. |
Scale(IPathCollection, float)
Creates a path translated by the supplied position
Declaration
public static IPathCollection Scale(this IPathCollection path, float scale)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | path | The path to translate. |
float | scale | The amount to scale along both the x and y axis. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a translate transform applied. |
Scale(IPathCollection, float, float)
Creates a path translated by the supplied position
Declaration
public static IPathCollection Scale(this IPathCollection path, float scaleX, float scaleY)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | path | The path to translate. |
float | scaleX | The amount to scale along the X axis. |
float | scaleY | The amount to scale along the Y axis. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a translate transform applied. |
Translate(IPath, PointF)
Creates a path translated by the supplied position
Declaration
public static IPath Translate(this IPath path, PointF position)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to translate. |
PointF | position | The translation position. |
Returns
Type | Description |
---|---|
IPath | A IPath with a translate transform applied. |
Translate(IPath, float, float)
Creates a path translated by the supplied position
Declaration
public static IPath Translate(this IPath path, float x, float y)
Parameters
Type | Name | Description |
---|---|---|
IPath | path | The path to translate. |
float | x | The amount to translate along the X axis. |
float | y | The amount to translate along the Y axis. |
Returns
Type | Description |
---|---|
IPath | A IPath with a translate transform applied. |
Translate(IPathCollection, PointF)
Creates a path translated by the supplied position
Declaration
public static IPathCollection Translate(this IPathCollection path, PointF position)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | path | The path to translate. |
PointF | position | The translation position. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a translate transform applied. |
Translate(IPathCollection, float, float)
Creates a path translated by the supplied position
Declaration
public static IPathCollection Translate(this IPathCollection path, float x, float y)
Parameters
Type | Name | Description |
---|---|---|
IPathCollection | path | The path to translate. |
float | x | The amount to translate along the X axis. |
float | y | The amount to translate along the Y axis. |
Returns
Type | Description |
---|---|
IPathCollection | A IPath with a translate transform applied. |