Pen Class

Summary: Defines an object used to draw lines, curves and figures.

Module: aspose.psd

Full Name: aspose.psd.Pen

Inheritance: TransparencySupporter

Aspose.PSD Version: 24.4.0

Constructors

NameDescription
Pen(brush)Initializes a new instance of the Pen class with the specified Pen.brush.
Pen(brush, width)Initializes a new instance of the Pen class with the specified Pen.brush and Pen.width.
Pen(color)Initializes a new instance of the Pen class with the specified color.
Pen(color, width)Initializes a new instance of the Pen class with the specified Pen.color and Pen.width properties.

Properties

NameTypeAccessDescription
alignmentPenAlignmentr/wGets or sets the alignment for this Pen.
brushBrushr/wGets or sets the Pen.brush that determines attributes of this Pen.
colorColorr/wGets or sets the color of this Pen.
compound_arrayfloatr/wGets or sets an array of values that specifies a compound pen. A compound pen draws a compound line made up of parallel lines and spaces.
custom_end_capCustomLineCapr/wGets or sets a custom cap to use at the end of lines drawn with this Pen.
custom_start_capCustomLineCapr/wGets or sets a custom cap to use at the beginning of lines drawn with this Pen.
dash_capDashCapr/wGets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen.
dash_offsetfloatr/wGets or sets the distance from the start of a line to the beginning of a dash pattern.
dash_patternfloatr/wGets or sets an array of custom dashes and spaces.
dash_styleDashStyler/wGets or sets the style used for dashed lines drawn with this Pen.
end_capLineCapr/wGets or sets the cap style used at the end of lines drawn with this Pen.
line_joinLineJoinr/wGets or sets the join style for the ends of two consecutive lines drawn with this Pen.
miter_limitfloatr/wGets or sets the limit of the thickness of the join on a mitered corner.
opacityfloatr/wGets or sets the object’s opacity. The value should be between 0 and 1. Value of 0 means that object is fully visible, value of 1 means the object is fully opaque.
pen_typePenTyperGets the style of lines drawn with this Pen.
start_capLineCapr/wGets or sets the cap style used at the beginning of lines drawn with this Pen.
transformMatrixr/wGets or sets a copy of the geometric transformation for this Pen.
widthfloatr/wGets or sets the width of this Pen, in units of the Graphics object used for drawing.

Methods

NameDescription
multiply_transform(matrix)Multiplies the transformation matrix for this Pen by the specified Matrix.
multiply_transform(matrix, order)Multiplies the transformation matrix for this Pen by the specified Matrix in the specified order.
reset_transform()Resets the geometric transformation matrix for this Pen to identity.
rotate_transform(angle)Rotates the local geometric transformation by the specified angle. This method prepends the rotation to the transformation.
rotate_transform(angle, order)Rotates the local geometric transformation by the specified angle in the specified order.
scale_transform(sx, sy)Scales the local geometric transformation by the specified factors. This method prepends the scaling matrix to the transformation.
scale_transform(sx, sy, order)Scales the local geometric transformation by the specified factors in the specified order.
set_line_cap(start_cap, end_cap, dash_cap)Sets the values that determine the style of cap used to end lines drawn by this Pen.
translate_transform(dx, dy)Translates the local geometric transformation by the specified dimensions. This method prepends the translation to the transformation.
translate_transform(dx, dy, order)Translates the local geometric transformation by the specified dimensions in the specified order.

Constructor: Pen(brush)

 Pen(brush) 

Initializes a new instance of the Pen class with the specified Pen.brush.

Parameters:

ParameterTypeDescription
brushBrushA Pen.brush that determines the fill properties of this Pen.

Constructor: Pen(brush, width)

 Pen(brush, width) 

Initializes a new instance of the Pen class with the specified Pen.brush and Pen.width.

Parameters:

ParameterTypeDescription
brushBrushA Pen.brush that determines the characteristics of this Pen.
widthfloatThe width of the new Pen.

Constructor: Pen(color)

 Pen(color) 

Initializes a new instance of the Pen class with the specified color.

Parameters:

ParameterTypeDescription
colorColorA Pen.color structure that indicates the color of this Pen.

Constructor: Pen(color, width)

 Pen(color, width) 

Initializes a new instance of the Pen class with the specified Pen.color and Pen.width properties.

Parameters:

ParameterTypeDescription
colorColorA Pen.color structure that indicates the color of this Pen.
widthfloatA value indicating the width of this Pen.

Method: multiply_transform(matrix)

 multiply_transform(matrix) 

Multiplies the transformation matrix for this Pen by the specified Matrix.

Parameters:

ParameterTypeDescription
matrixMatrixThe Matrix object by which to multiply the transformation matrix.

Method: multiply_transform(matrix, order)

 multiply_transform(matrix, order) 

Multiplies the transformation matrix for this Pen by the specified Matrix in the specified order.

Parameters:

ParameterTypeDescription
matrixMatrixThe Matrix by which to multiply the transformation matrix.
orderMatrixOrderThe order in which to perform the multiplication operation.

Method: rotate_transform(angle)

 rotate_transform(angle) 

Rotates the local geometric transformation by the specified angle. This method prepends the rotation to the transformation.

Parameters:

ParameterTypeDescription
anglefloatThe angle of rotation.

Method: rotate_transform(angle, order)

 rotate_transform(angle, order) 

Rotates the local geometric transformation by the specified angle in the specified order.

Parameters:

ParameterTypeDescription
anglefloatThe angle of rotation.
orderMatrixOrderA MatrixOrder that specifies whether to append or prepend the rotation matrix.

Method: scale_transform(sx, sy)

 scale_transform(sx, sy) 

Scales the local geometric transformation by the specified factors. This method prepends the scaling matrix to the transformation.

Parameters:

ParameterTypeDescription
sxfloatThe factor by which to scale the transformation in the x-axis direction.
syfloatThe factor by which to scale the transformation in the y-axis direction.

Method: scale_transform(sx, sy, order)

 scale_transform(sx, sy, order) 

Scales the local geometric transformation by the specified factors in the specified order.

Parameters:

ParameterTypeDescription
sxfloatThe factor by which to scale the transformation in the x-axis direction.
syfloatThe factor by which to scale the transformation in the y-axis direction.
orderMatrixOrderA MatrixOrder that specifies whether to append or prepend the scaling matrix.

Method: set_line_cap(start_cap, end_cap, dash_cap)

 set_line_cap(start_cap, end_cap, dash_cap) 

Sets the values that determine the style of cap used to end lines drawn by this Pen.

Parameters:

ParameterTypeDescription
start_capLineCapA LineCap that represents the cap style to use at the beginning of lines drawn with this Pen.
end_capLineCapA LineCap that represents the cap style to use at the end of lines drawn with this Pen.
dash_capDashCapA LineCap that represents the cap style to use at the beginning or end of dashed lines drawn with this Pen.

Method: translate_transform(dx, dy)

 translate_transform(dx, dy) 

Translates the local geometric transformation by the specified dimensions. This method prepends the translation to the transformation.

Parameters:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe value of the translation in y.

Method: translate_transform(dx, dy, order)

 translate_transform(dx, dy, order) 

Translates the local geometric transformation by the specified dimensions in the specified order.

Parameters:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe value of the translation in y.
orderMatrixOrderThe order (prepend or append) in which to apply the translation.