Table of Contents

Class PolygonShape

Namespace
Aspose.Imaging.Shapes
Assembly
Aspose.Imaging.dll

Represents a polygon shape.

public class PolygonShape : Shape, IOrderedShape
Inheritance
PolygonShape
Implements
Derived
Inherited Members

Constructors

PolygonShape()

Initializes a new instance of the PolygonShape class.

public PolygonShape()

PolygonShape(PointF[])

Initializes a new instance of the PolygonShape class.

public PolygonShape(PointF[] points)

Parameters

points PointF[]

The points array.

PolygonShape(PointF[], bool)

Initializes a new instance of the PolygonShape class.

public PolygonShape(PointF[] points, bool isClosed)

Parameters

points PointF[]

The points array.

isClosed bool

If set to true the polygon is closed.

Properties

Bounds

Gets the object's bounds.

public override RectangleF Bounds { get; }

Property Value

RectangleF

The object's bounds.

Center

Gets the shape's center.

public override PointF Center { get; }

Property Value

PointF

The shape's center.

EndPoint

Gets the ending shape point.

public virtual PointF EndPoint { get; }

Property Value

PointF

The ending shape point.

HasSegments

Gets a value indicating whether shape has segments.

public override bool HasSegments { get; }

Property Value

bool

True if shape has segments; otherwise, false.

IsClosed

Gets or sets a value indicating whether shape is closed.

public bool IsClosed { get; set; }

Property Value

bool

true if shape is closed; otherwise, false.

Points

Gets or sets the curve points.

public PointF[] Points { get; set; }

Property Value

PointF[]

The curve points.

Segments

Gets the shape segments.

public override ShapeSegment[] Segments { get; }

Property Value

ShapeSegment[]

The shape segments.

StartPoint

Gets the starting shape point.

public virtual PointF StartPoint { get; }

Property Value

PointF

The starting shape point.

Methods

Equals(PolygonShape)

Check if objects are equal.

protected bool Equals(PolygonShape other)

Parameters

other PolygonShape

The other object.

Returns

bool

The equality comparison result.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The compared object.

Returns

bool

The result of equals

GetBounds(Matrix)

Gets the object's bounds.

public override RectangleF GetBounds(Matrix matrix)

Parameters

matrix Matrix

The matrix to apply before bounds will be calculated.

Returns

RectangleF

The estimated object's bounds.

GetBounds(Matrix, Pen)

Gets the object's bounds.

public override RectangleF GetBounds(Matrix matrix, Pen pen)

Parameters

matrix Matrix

The matrix to apply before bounds will be calculated.

pen Pen

The pen to use for object. This can influence the object's bounds size.

Returns

RectangleF

The estimated object's bounds.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Reverse()

Reverses the order of points for this shape.

public void Reverse()

Transform(Matrix)

Applies the specified transformation to the shape.

public override void Transform(Matrix transform)

Parameters

transform Matrix

The transformation to apply.