Pen

Inheritance: java.lang.Object, com.aspose.psd.TransparencySupporter

public class Pen extends TransparencySupporter

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

Constructors

ConstructorDescription
Pen(Color color)Initializes a new instance of the Pen class with the specified color.
Pen(Color color, float width)Initializes a new instance of the Pen class with the specified Color and Pen.Width properties.
Pen(Brush brush)Initializes a new instance of the Pen class with the specified Brush .
Pen(Brush brush, float width)Initializes a new instance of the Pen class with the specified Brush and Pen.Width .

Methods

MethodDescription
equals(Object arg0)
getAlignment()Gets the alignment for this Pen .
getBrush()Gets the Brush that determines attributes of this Pen .
getClass()
getColor()Gets the color of this Pen .
getCompoundArray()Gets an array of values that specifies a compound pen.
getCustomEndCap()Gets a custom cap to use at the end of lines drawn with this Pen .
getCustomStartCap()Gets a custom cap to use at the beginning of lines drawn with this Pen .
getDashCap()Gets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen .
getDashOffset()Gets the distance from the start of a line to the beginning of a dash pattern.
getDashPattern()Gets an array of custom dashes and spaces.
getDashStyle()Gets the style used for dashed lines drawn with this Pen .
getEndCap()Gets the cap style used at the end of lines drawn with this Pen .
getLineJoin()Gets the join style for the ends of two consecutive lines drawn with this Pen .
getMiterLimit()Gets the limit of the thickness of the join on a mitered corner.
getOpacity()Gets the object’s opacity.
getPenType()Gets the style of lines drawn with this Pen .
getStartCap()Gets the cap style used at the beginning of lines drawn with this Pen .
getTransform()Gets a copy of the geometric transformation for this Pen .
getWidth()Gets the width of this Pen , in units of the Graphics object used for drawing.
hashCode()
multiplyTransform(Matrix matrix)Multiplies the transformation matrix for this Pen by the specified Matrix .
multiplyTransform(Matrix matrix, int order)Multiplies the transformation matrix for this Pen by the specified Matrix in the specified order.
notify()
notifyAll()
resetTransform()Resets the geometric transformation matrix for this Pen to identity.
rotateTransform(float angle)Rotates the local geometric transformation by the specified angle.
rotateTransform(float angle, int order)Rotates the local geometric transformation by the specified angle in the specified order.
scaleTransform(float sx, float sy)Scales the local geometric transformation by the specified factors.
scaleTransform(float sx, float sy, int order)Scales the local geometric transformation by the specified factors in the specified order.
setAlignment(int value)Sets the alignment for this Pen .
setBrush(Brush value)Sets the Brush that determines attributes of this Pen .
setColor(Color value)Sets the color of this Pen .
setCompoundArray(float[] value)Sets an array of values that specifies a compound pen.
setCustomEndCap(CustomLineCap value)Sets a custom cap to use at the end of lines drawn with this Pen .
setCustomStartCap(CustomLineCap value)Sets a custom cap to use at the beginning of lines drawn with this Pen .
setDashCap(int value)Sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen .
setDashOffset(float value)Sets the distance from the start of a line to the beginning of a dash pattern.
setDashPattern(float[] value)Sets an array of custom dashes and spaces.
setDashStyle(int value)Sets the style used for dashed lines drawn with this Pen .
setEndCap(int value)Sets the cap style used at the end of lines drawn with this Pen .
setLineCap(int startCap, int endCap, int dashCap)Sets the values that determine the style of cap used to end lines drawn by this Pen .
setLineJoin(int value)Sets the join style for the ends of two consecutive lines drawn with this Pen .
setMiterLimit(float value)Sets the limit of the thickness of the join on a mitered corner.
setOpacity(float value)Sets the object’s opacity.
setStartCap(int value)Sets the cap style used at the beginning of lines drawn with this Pen .
setTransform(Matrix value)Sets a copy of the geometric transformation for this Pen .
setWidth(float value)Sets the width of this Pen , in units of the Graphics object used for drawing.
toString()
translateTransform(float dx, float dy)Translates the local geometric transformation by the specified dimensions.
translateTransform(float dx, float dy, int order)Translates the local geometric transformation by the specified dimensions in the specified order.
wait()
wait(long arg0)
wait(long arg0, int arg1)

Pen(Color color)

public Pen(Color color)

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

Parameters:

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

Pen(Color color, float width)

public Pen(Color color, float width)

Initializes a new instance of the Pen class with the specified Color and Pen.Width properties.

Parameters:

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

Pen(Brush brush)

public Pen(Brush brush)

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

Parameters:

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

Pen(Brush brush, float width)

public Pen(Brush brush, float width)

Initializes a new instance of the Pen class with the specified Brush and Pen.Width .

Parameters:

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

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAlignment()

public int getAlignment()

Gets the alignment for this Pen .

Returns: int - A PenAlignment that represents the alignment for this Pen .

getBrush()

public Brush getBrush()

Gets the Brush that determines attributes of this Pen .

Returns: Brush - A Brush that determines attributes of this Pen .

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor()

public Color getColor()

Gets the color of this Pen .

Returns: Color - A Color structure that represents the color of this Pen .

getCompoundArray()

public float[] getCompoundArray()

Gets an array of values that specifies a compound pen. A compound pen draws a compound line made up of parallel lines and spaces.

Returns: float[] - An array of real numbers that specifies the compound array. The elements in the array must be in increasing order, not less than 0, and not greater than 1.

getCustomEndCap()

public CustomLineCap getCustomEndCap()

Gets a custom cap to use at the end of lines drawn with this Pen .

Returns: CustomLineCap - A CustomLineCap that represents the cap used at the end of lines drawn with this Pen .

getCustomStartCap()

public CustomLineCap getCustomStartCap()

Gets a custom cap to use at the beginning of lines drawn with this Pen .

Returns: CustomLineCap - A CustomLineCap that represents the cap used at the beginning of lines drawn with this Pen .

getDashCap()

public int getDashCap()

Gets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen .

Returns: int - One of the DashCap values that represents the cap style used at the beginning and end of the dashes that make up dashed lines drawn with this Pen .

getDashOffset()

public float getDashOffset()

Gets the distance from the start of a line to the beginning of a dash pattern.

Returns: float - The distance from the start of a line to the beginning of a dash pattern.

getDashPattern()

public float[] getDashPattern()

Gets an array of custom dashes and spaces.

Returns: float[] - An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.

getDashStyle()

public int getDashStyle()

Gets the style used for dashed lines drawn with this Pen .

Returns: int - A DashStyle that represents the style used for dashed lines drawn with this Pen .

getEndCap()

public int getEndCap()

Gets the cap style used at the end of lines drawn with this Pen .

Returns: int - One of the LineCap values that represents the cap style used at the end of lines drawn with this Pen .

getLineJoin()

public int getLineJoin()

Gets the join style for the ends of two consecutive lines drawn with this Pen .

Returns: int - A LineJoin that represents the join style for the ends of two consecutive lines drawn with this Pen .

getMiterLimit()

public float getMiterLimit()

Gets the limit of the thickness of the join on a mitered corner.

Returns: float - The limit of the thickness of the join on a mitered corner.

getOpacity()

public float getOpacity()

Gets 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.

Returns: float - The opacity value.

getPenType()

public int getPenType()

Gets the style of lines drawn with this Pen .

Returns: int - A PenType enumeration that specifies the style of lines drawn with this Pen .

getStartCap()

public int getStartCap()

Gets the cap style used at the beginning of lines drawn with this Pen .

Returns: int - One of the LineCap values that represents the cap style used at the beginning of lines drawn with this Pen .

getTransform()

public Matrix getTransform()

Gets a copy of the geometric transformation for this Pen .

Returns: Matrix - A copy of the Matrix that represents the geometric transformation for this Pen .

getWidth()

public float getWidth()

Gets the width of this Pen , in units of the Graphics object used for drawing.

Returns: float - The width of this Pen .

hashCode()

public native int hashCode()

Returns: int

multiplyTransform(Matrix matrix)

public void multiplyTransform(Matrix matrix)

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

Parameters:

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

multiplyTransform(Matrix matrix, int order)

public void multiplyTransform(Matrix matrix, int 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.
orderintThe order in which to perform the multiplication operation.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

resetTransform()

public void resetTransform()

Resets the geometric transformation matrix for this Pen to identity.

rotateTransform(float angle)

public void rotateTransform(float angle)

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

Parameters:

ParameterTypeDescription
anglefloatThe angle of rotation.

rotateTransform(float angle, int order)

public void rotateTransform(float angle, int order)

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

Parameters:

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

scaleTransform(float sx, float sy)

public void scaleTransform(float sx, float 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.

scaleTransform(float sx, float sy, int order)

public void scaleTransform(float sx, float sy, int 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.
orderintA MatrixOrder that specifies whether to append or prepend the scaling matrix.

setAlignment(int value)

public void setAlignment(int value)

Sets the alignment for this Pen .

Parameters:

ParameterTypeDescription
valueintA PenAlignment that represents the alignment for this Pen .

setBrush(Brush value)

public void setBrush(Brush value)

Sets the Brush that determines attributes of this Pen .

Parameters:

ParameterTypeDescription
valueBrushA Brush that determines attributes of this Pen .

setColor(Color value)

public void setColor(Color value)

Sets the color of this Pen .

Parameters:

ParameterTypeDescription
valueColorA Color structure that represents the color of this Pen .

setCompoundArray(float[] value)

public void setCompoundArray(float[] value)

Sets an array of values that specifies a compound pen. A compound pen draws a compound line made up of parallel lines and spaces.

Parameters:

ParameterTypeDescription
valuefloat[]An array of real numbers that specifies the compound array. The elements in the array must be in increasing order, not less than 0, and not greater than 1.

setCustomEndCap(CustomLineCap value)

public void setCustomEndCap(CustomLineCap value)

Sets a custom cap to use at the end of lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueCustomLineCapA CustomLineCap that represents the cap used at the end of lines drawn with this Pen .

setCustomStartCap(CustomLineCap value)

public void setCustomStartCap(CustomLineCap value)

Sets a custom cap to use at the beginning of lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueCustomLineCapA CustomLineCap that represents the cap used at the beginning of lines drawn with this Pen .

setDashCap(int value)

public void setDashCap(int value)

Sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueintOne of the DashCap values that represents the cap style used at the beginning and end of the dashes that make up dashed lines drawn with this Pen .

setDashOffset(float value)

public void setDashOffset(float value)

Sets the distance from the start of a line to the beginning of a dash pattern.

Parameters:

ParameterTypeDescription
valuefloatThe distance from the start of a line to the beginning of a dash pattern.

setDashPattern(float[] value)

public void setDashPattern(float[] value)

Sets an array of custom dashes and spaces.

Parameters:

ParameterTypeDescription
valuefloat[]An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.

setDashStyle(int value)

public void setDashStyle(int value)

Sets the style used for dashed lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueintA DashStyle that represents the style used for dashed lines drawn with this Pen .

setEndCap(int value)

public void setEndCap(int value)

Sets the cap style used at the end of lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueintOne of the LineCap values that represents the cap style used at the end of lines drawn with this Pen .

setLineCap(int startCap, int endCap, int dashCap)

public void setLineCap(int startCap, int endCap, int dashCap)

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

Parameters:

ParameterTypeDescription
startCapintA LineCap that represents the cap style to use at the beginning of lines drawn with this Pen .
endCapintA LineCap that represents the cap style to use at the end of lines drawn with this Pen .
dashCapintA LineCap that represents the cap style to use at the beginning or end of dashed lines drawn with this Pen .

setLineJoin(int value)

public void setLineJoin(int value)

Sets the join style for the ends of two consecutive lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueintA LineJoin that represents the join style for the ends of two consecutive lines drawn with this Pen .

setMiterLimit(float value)

public void setMiterLimit(float value)

Sets the limit of the thickness of the join on a mitered corner.

Parameters:

ParameterTypeDescription
valuefloatThe limit of the thickness of the join on a mitered corner.

setOpacity(float value)

public void setOpacity(float value)

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.

Parameters:

ParameterTypeDescription
valuefloatThe opacity value.

setStartCap(int value)

public void setStartCap(int value)

Sets the cap style used at the beginning of lines drawn with this Pen .

Parameters:

ParameterTypeDescription
valueintOne of the LineCap values that represents the cap style used at the beginning of lines drawn with this Pen .

setTransform(Matrix value)

public void setTransform(Matrix value)

Sets a copy of the geometric transformation for this Pen .

Parameters:

ParameterTypeDescription
valueMatrixA copy of the Matrix that represents the geometric transformation for this Pen .

setWidth(float value)

public void setWidth(float value)

Sets the width of this Pen , in units of the Graphics object used for drawing.

Parameters:

ParameterTypeDescription
valuefloatThe width of this Pen .

toString()

public String toString()

Returns: java.lang.String

translateTransform(float dx, float dy)

public void translateTransform(float dx, float 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.

translateTransform(float dx, float dy, int order)

public void translateTransform(float dx, float dy, int 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.
orderintThe order (prepend or append) in which to apply the translation.

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int