Figure Class

Summary: The figure. A container for shapes.

Module: aspose.psd

Full Name: aspose.psd.Figure

Inheritance: ObjectWithBounds

Aspose.PSD Version: 24.9.0

Constructors

NameDescription
Figure()Initializes a new instance of the Figure class

Properties

NameTypeAccessDescription
boundsRectangleFrGets or sets the object’s bounds.
is_closedboolr/wGets or sets a value indicating whether this figure is closed. A closed figure will make a difference only in case where
the first and the last figure’s shapes are continuous shapes. In such case the first point of the first shape will be
connected by a straight line from the last point of the last shape.
segmentsShapeSegment[]rGets the whole figure segments.
shapesShape[]rGets the figure shapes.

Methods

NameDescription
add_shape(shape)Adds a shape to the figure.
add_shapes(shapes)Adds a range of shapes to the figure.
get_bounds(matrix)Gets the object’s bounds.
get_bounds(matrix, pen)Gets the object’s bounds.
remove_shape(shape)Removes a shape from the figure.
remove_shapes(shapes)Removes a range of shapes from the figure.
reverse()Reverses this figure shapes order and shapes point order.
transform(transform)Applies the specified transformation to the shape.

Constructor: Figure()

 Figure() 

Initializes a new instance of the Figure class

Method: add_shape(shape)

 add_shape(shape) 

Adds a shape to the figure.

Parameters:

ParameterTypeDescription
shapeShapeThe shape to add.

Method: add_shapes(shapes)

 add_shapes(shapes) 

Adds a range of shapes to the figure.

Parameters:

ParameterTypeDescription
shapesShape[]The shapes to add.

Method: get_bounds(matrix)

 get_bounds(matrix) 

Gets the object’s bounds.

Parameters:

ParameterTypeDescription
matrixMatrixThe matrix to apply before bounds will be calculated.

Returns

TypeDescription
RectangleFThe estimated object’s bounds.

Method: get_bounds(matrix, pen)

 get_bounds(matrix, pen) 

Gets the object’s bounds.

Parameters:

ParameterTypeDescription
matrixMatrixThe matrix to apply before bounds will be calculated.
penPenThe pen to use for object. This can influence the object’s bounds size.

Returns

TypeDescription
RectangleFThe estimated object’s bounds.

Method: remove_shape(shape)

 remove_shape(shape) 

Removes a shape from the figure.

Parameters:

ParameterTypeDescription
shapeShapeThe shape to remove.

Method: remove_shapes(shapes)

 remove_shapes(shapes) 

Removes a range of shapes from the figure.

Parameters:

ParameterTypeDescription
shapesShape[]The shapes range to remove.

Method: transform(transform)

 transform(transform) 

Applies the specified transformation to the shape.

Parameters:

ParameterTypeDescription
transformMatrixThe transformation to apply.