Class ComplexPolygon
- Namespace
- SixLabors.ImageSharp.Drawing
- Assembly
- SixLabors.ImageSharp.Drawing.dll
Represents a complex polygon made up of one or more shapes overlayed on each other, where overlaps causes holes.
public sealed class ComplexPolygon : IPath
- Inheritance
-
ComplexPolygon
- Implements
- Inherited Members
- Extension Methods
Constructors
ComplexPolygon(params IPath[])
Initializes a new instance of the ComplexPolygon class.
public ComplexPolygon(params IPath[] paths)
Parameters
pathsIPath[]The paths.
ComplexPolygon(PointF[], PointF[])
Initializes a new instance of the ComplexPolygon class.
public ComplexPolygon(PointF[] contour, PointF[] hole)
Parameters
ComplexPolygon(IEnumerable<IPath>)
Initializes a new instance of the ComplexPolygon class.
public ComplexPolygon(IEnumerable<IPath> paths)
Parameters
pathsIEnumerable<IPath>The paths.
Properties
Bounds
Gets the bounds enclosing the path.
public RectangleF Bounds { get; }
Property Value
PathType
Gets a value indicating whether this instance is closed, open or a composite path with a mixture of open and closed figures.
public PathTypes PathType { get; }
Property Value
Paths
Gets the collection of paths that make up this shape.
public IEnumerable<IPath> Paths { get; }
Property Value
Methods
AsClosedPath()
Returns this path with all figures closed.
public IPath AsClosedPath()
Returns
Flatten()
Converts the IPath into a simple linear path.
public IEnumerable<ISimplePath> Flatten()
Returns
- IEnumerable<ISimplePath>
Returns the current IPath as simple linear path.
ToLinearGeometry(Vector2)
Converts this path into a retained LinearGeometry, flattening curves at the precision of
the supplied device-space scale.
public LinearGeometry ToLinearGeometry(Vector2 scale)
Parameters
scaleVector2The X/Y scale at which curves are flattened.
Returns
- LinearGeometry
The retained linear geometry.
Transform(Matrix4x4)
Transforms the path using the specified matrix.
public IPath Transform(Matrix4x4 matrix)
Parameters
matrixMatrix4x4The matrix.
Returns
- IPath
A new path with the matrix applied to it.