Pen
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.ms.System.IDisposable
public class Pen implements System.IDisposable
Defines an object used to draw lines and curves.
Constructors
Constructor | Description |
---|---|
Pen(Color color) | Initializes a new instance of the Pen class with the specified Color (.getColor/.setColor(Color)). |
Pen(Brush brush, float width) | Initializes a new instance of the Pen class with the specified Brush and Width. |
Pen(Brush brush) | Initializes a new instance of the Pen class with the specified Brush (.getBrush/.setBrush(Brush)). |
Pen(Color color, float width) | Initializes a new instance of the Pen class with the specified Color and Width properties. |
Methods
Method | Description |
---|---|
getColor() | Gets or sets the color of this Pen. |
setColor(Color value) | Gets or sets the color of this Pen. |
getBrush() | Gets or sets the Brush that determines attributes of this Pen. |
setBrush(Brush value) | Gets or sets the Brush that determines attributes of this Pen. |
getCompoundArray() | Gets or sets an array of values that specifies a compound pen. |
setCompoundArray(float[] value) | Gets or sets an array of values that specifies a compound pen. |
getWidth() | Gets or sets the width of this Pen, in units of the Graphics object used for drawing. |
setWidth(float value) | Gets or sets the width of this Pen, in units of the Graphics object used for drawing. |
getStartCap() | Gets or sets the cap style used at the beginning of lines drawn with this Pen. |
setStartCap(int value) | Gets or sets the cap style used at the beginning of lines drawn with this Pen. |
getEndCap() | Gets or sets the cap style used at the end of lines drawn with this Pen. |
setEndCap(int value) | Gets or sets the cap style used at the end of lines drawn with this Pen. |
getLineJoin() | Gets or sets the join style for the ends of two consecutive lines drawn with this Pen. |
setLineJoin(int value) | Gets or sets the join style for the ends of two consecutive lines drawn with this Pen. |
getMiterLimit() | Gets or sets the limit of the thickness of the join on a mitered corner. |
setMiterLimit(float value) | Gets or sets the limit of the thickness of the join on a mitered corner. |
getAlignment() | Gets or sets the alignment for this Pen. |
setAlignment(int value) | Gets or sets the alignment for this Pen. |
getTransform() | Gets or sets a copy of the geometric transformation for this Pen. |
setTransform(Matrix value) | Gets or sets a copy of the geometric transformation for this Pen. |
getCustomStartCap() | Gets or sets a custom cap to use at the beginning of lines drawn with this Pen. |
setCustomStartCap(CustomLineCap value) | Gets or sets a custom cap to use at the beginning of lines drawn with this Pen. |
getCustomEndCap() | Gets or sets a custom cap to use at the end of lines drawn with this Pen. |
setCustomEndCap(CustomLineCap value) | Gets or sets a custom cap to use at the end of lines drawn with this Pen. |
getDashCap() | Gets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen. |
setDashCap(int value) | Gets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen. |
getDashOffset() | Gets or sets the distance from the start of a line to the beginning of a dash pattern. |
setDashOffset(float value) | Gets or sets the distance from the start of a line to the beginning of a dash pattern. |
getDashPattern() | Gets or sets an array of custom dashes and spaces. |
setDashPattern(float[] value) | Gets or sets an array of custom dashes and spaces. |
getDashStyle() | Gets or sets the style used for dashed lines drawn with this Pen. |
setDashStyle(int value) | Gets or sets the style used for dashed lines drawn with this Pen. |
getPenType() | Gets the style of lines drawn with this Pen. |
dispose() | Releases all resources used by this Pen. |
deepClone() | Creates an exact copy of 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. |
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. |
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. |
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. |
resetTransform() | Resets the geometric transformation matrix for this Pen to identity. |
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. |
Pen(Color color)
public Pen(Color color)
Initializes a new instance of the Pen class with the specified Color
(.getColor/.setColor(Color)).
Parameters:
Parameter | Type | Description |
---|---|---|
color | Color | A Color (.getColor/.setColor(Color)) 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 Width.
Parameters:
Parameter | Type | Description |
---|---|---|
brush | Brush | A Brush that determines the characteristics of this Pen. |
width | float | The width of the new Pen. |
Pen(Brush brush)
public Pen(Brush brush)
Initializes a new instance of the Pen class with the specified Brush
(.getBrush/.setBrush(Brush)).
Parameters:
Parameter | Type | Description |
---|---|---|
brush | Brush | A Brush (.getBrush/.setBrush(Brush)) that determines the fill properties 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 Width properties.
Parameters:
Parameter | Type | Description |
---|---|---|
color | Color | A Color structure that indicates the color of this Pen. |
width | float | A value indicating the width of this Pen. |
getColor()
public final Color getColor()
Gets or sets the color of this Pen.
Value: A Color
(.getColor/.setColor(Color)) structure that represents the color of this Pen.
Returns: Color
setColor(Color value)
public final void setColor(Color value)
Gets or sets the color of this Pen.
Value: A Color
(.getColor/.setColor(Color)) structure that represents the color of this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Color |
getBrush()
public final Brush getBrush()
Gets or sets the Brush that determines attributes of this Pen.
Returns: Brush
setBrush(Brush value)
public final void setBrush(Brush value)
Gets or sets the Brush that determines attributes of this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Brush |
getCompoundArray()
public final float[] getCompoundArray()
Gets 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.
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.
setCompoundArray(float[] value)
public final void setCompoundArray(float[] value)
Gets 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.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float[] |
getWidth()
public final float getWidth()
Gets or sets the width of this Pen, in units of the Graphics object used for drawing.
Returns: float
setWidth(float value)
public final void setWidth(float value)
Gets or sets the width of this Pen, in units of the Graphics object used for drawing.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getStartCap()
public final int getStartCap()
Gets or sets the cap style used at the beginning of lines drawn with this Pen.
Returns: int
setStartCap(int value)
public final void setStartCap(int value)
Gets or sets the cap style used at the beginning of lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getEndCap()
public final int getEndCap()
Gets or sets the cap style used at the end of lines drawn with this Pen.
Returns: int
setEndCap(int value)
public final void setEndCap(int value)
Gets or sets the cap style used at the end of lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getLineJoin()
public final int getLineJoin()
Gets or sets the join style for the ends of two consecutive lines drawn with this Pen.
At the moment Miter join actually works as MiterClipped.
Returns: int
setLineJoin(int value)
public final void setLineJoin(int value)
Gets or sets the join style for the ends of two consecutive lines drawn with this Pen.
At the moment Miter join actually works as MiterClipped.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getMiterLimit()
public final float getMiterLimit()
Gets or sets the limit of the thickness of the join on a mitered corner.
Returns: float
setMiterLimit(float value)
public final void setMiterLimit(float value)
Gets or sets the limit of the thickness of the join on a mitered corner.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getAlignment()
public final int getAlignment()
Gets or sets the alignment for this Pen.
Returns: int - A PenAlignment that represents the alignment for this Pen.
setAlignment(int value)
public final void setAlignment(int value)
Gets or sets the alignment for this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getTransform()
public final Matrix getTransform()
Gets or sets a copy of the geometric transformation for this Pen.
Value: A copy of the Matrix that represents the geometric transformation for this Pen.
Returns: Matrix
setTransform(Matrix value)
public final void setTransform(Matrix value)
Gets or sets a copy of the geometric transformation for this Pen.
Value: A copy of the Matrix that represents the geometric transformation for this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Matrix |
getCustomStartCap()
public final CustomLineCap getCustomStartCap()
Gets or sets 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.
setCustomStartCap(CustomLineCap value)
public final void setCustomStartCap(CustomLineCap value)
Gets or sets a custom cap to use at the beginning of lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | CustomLineCap |
getCustomEndCap()
public final CustomLineCap getCustomEndCap()
Gets or sets 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.
setCustomEndCap(CustomLineCap value)
public final void setCustomEndCap(CustomLineCap value)
Gets or sets a custom cap to use at the end of lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | CustomLineCap |
getDashCap()
public final int getDashCap()
Gets or sets 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
(.getDashCap/.setDashCap(int)) values that represents the cap style used at the beginning and end of the dashes that make up dashed lines drawn with this Pen.
setDashCap(int value)
public final void setDashCap(int value)
Gets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getDashOffset()
public final float getDashOffset()
Gets or sets 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.
setDashOffset(float value)
public final void setDashOffset(float value)
Gets or sets the distance from the start of a line to the beginning of a dash pattern.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getDashPattern()
public final float[] getDashPattern()
Gets or sets 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.
setDashPattern(float[] value)
public final void setDashPattern(float[] value)
Gets or sets an array of custom dashes and spaces.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float[] |
getDashStyle()
public final int getDashStyle()
Gets or sets the style used for dashed lines drawn with this Pen.
Returns:
int - A DashStyle
(.getDashStyle/.setDashStyle(int)) that represents the style used for dashed lines drawn with this Pen.
setDashStyle(int value)
public final void setDashStyle(int value)
Gets or sets the style used for dashed lines drawn with this Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getPenType()
public final int getPenType()
Gets the style of lines drawn with this Pen.
Value: A PenType
(.getPenType) enumeration that specifies the style of lines drawn with this Pen.
Returns: int
dispose()
public final void dispose()
Releases all resources used by this Pen.
This method actually does nothing. It’s just for compatibility with System.Drawing API.
deepClone()
public final Object deepClone()
Creates an exact copy of this Pen.
Returns: java.lang.Object - An Object that can be cast to a Pen.
setLineCap(int startCap, int endCap, int dashCap)
public final 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:
Parameter | Type | Description |
---|---|---|
startCap | int | A LineCap that represents the cap style to use at the beginning of lines drawn with this Pen. |
endCap | int | A LineCap that represents the cap style to use at the end of lines drawn with this Pen. |
dashCap | int | A LineCap that represents the cap style to use at the beginning or end of dashed lines drawn with this Pen. |
scaleTransform(float sx, float sy)
public final 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:
Parameter | Type | Description |
---|---|---|
sx | float | The factor by which to scale the transformation in the x-axis direction. |
sy | float | The factor by which to scale the transformation in the y-axis direction. |
scaleTransform(float sx, float sy, int order)
public final void scaleTransform(float sx, float sy, int order)
Scales the local geometric transformation by the specified factors in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
sx | float | The factor by which to scale the transformation in the x-axis direction. |
sy | float | The factor by which to scale the transformation in the y-axis direction. |
order | int | A MatrixOrder that specifies whether to append or prepend the scaling matrix. |
translateTransform(float dx, float dy)
public final void translateTransform(float dx, float dy)
Translates the local geometric transformation by the specified dimensions. This method prepends the translation to the transformation.
Parameters:
Parameter | Type | Description |
---|---|---|
dx | float | The value of the translation in x. |
dy | float | The value of the translation in y. |
translateTransform(float dx, float dy, int order)
public final void translateTransform(float dx, float dy, int order)
Translates the local geometric transformation by the specified dimensions in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
dx | float | The value of the translation in x. |
dy | float | The value of the translation in y. |
order | int | The order (prepend or append) in which to apply the translation. |
rotateTransform(float angle)
public final void rotateTransform(float angle)
Rotates the local geometric transformation by the specified angle. This method prepends the rotation to the transformation.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle of rotation. |
rotateTransform(float angle, int order)
public final void rotateTransform(float angle, int order)
Rotates the local geometric transformation by the specified angle in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle of rotation. |
order | int | A MatrixOrder that specifies whether to append or prepend the rotation matrix. |
resetTransform()
public final void resetTransform()
Resets the geometric transformation matrix for this Pen to identity.
multiplyTransform(Matrix matrix)
public final void multiplyTransform(Matrix matrix)
Multiplies the transformation matrix for this Pen by the specified Matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The Matrix object by which to multiply the transformation matrix. |
multiplyTransform(Matrix matrix, int order)
public final void multiplyTransform(Matrix matrix, int order)
Multiplies the transformation matrix for this Pen by the specified Matrix in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The java.awt.geom.AffineTransform by which to multiply the transformation matrix. |
order | int | The order in which to perform the multiplication operation. |