public class Pen extends TransparencySupporter
Defines an object used to draw lines, curves and figures.
Constructor and Description |
---|
Pen(Brush brush)
Initializes a new instance of the
Pen class with the specified Brush (Pen.getBrush() /Pen.setBrush(Brush) ). |
Pen(Brush brush,
float width)
Initializes a new instance of the
Pen class with the specified Brush (Pen.getBrush() /Pen.setBrush(Brush) ) and Pen.Width (Pen.getWidth() /Pen.setWidth(float) ). |
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 (Pen.getColor() /Pen.setColor(Color) ) and Pen.Width (Pen.getWidth() /Pen.setWidth(float) ) properties. |
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Gets or sets the alignment for this
Pen . |
Brush |
getBrush()
|
Color |
getColor()
Gets or sets the color of this
Pen . |
float[] |
getCompoundArray()
Gets or sets an array of values that specifies a compound pen.
|
CustomLineCap |
getCustomEndCap()
Gets or sets a custom cap to use at the end of lines drawn with this
Pen . |
CustomLineCap |
getCustomStartCap()
Gets or sets a custom cap to use at the beginning of lines drawn with this
Pen . |
int |
getDashCap()
Gets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this
Pen . |
float |
getDashOffset()
Gets or sets the distance from the start of a line to the beginning of a dash pattern.
|
float[] |
getDashPattern()
Gets or sets an array of custom dashes and spaces.
|
int |
getDashStyle()
Gets or sets the style used for dashed lines drawn with this
Pen . |
int |
getEndCap()
Gets or sets the cap style used at the end of lines drawn with this
Pen . |
int |
getLineJoin()
Gets or sets the join style for the ends of two consecutive lines drawn with this
Pen . |
float |
getMiterLimit()
Gets or sets the limit of the thickness of the join on a mitered corner.
|
int |
getPenType()
Gets the style of lines drawn with this
Pen . |
int |
getStartCap()
Gets or sets the cap style used at the beginning of lines drawn with this
Pen . |
Matrix |
getTransform()
Gets or sets a copy of the geometric transformation for this
Pen . |
float |
getWidth()
Gets or sets the width of this
Pen , in units of the Graphics object used for drawing. |
void |
multiplyTransform(Matrix matrix)
|
void |
multiplyTransform(Matrix matrix,
int order)
|
void |
resetTransform()
Resets the geometric transformation matrix for this
Pen to identity. |
void |
rotateTransform(float angle)
Rotates the local geometric transformation by the specified angle.
|
void |
rotateTransform(float angle,
int order)
Rotates the local geometric transformation by the specified angle in the specified order.
|
void |
scaleTransform(float sx,
float sy)
Scales the local geometric transformation by the specified factors.
|
void |
scaleTransform(float sx,
float sy,
int order)
Scales the local geometric transformation by the specified factors in the specified order.
|
void |
setAlignment(int value)
Gets or sets the alignment for this
Pen . |
void |
setBrush(Brush value)
|
void |
setColor(Color value)
Gets or sets the color of this
Pen . |
void |
setCompoundArray(float[] value)
Gets or sets an array of values that specifies a compound pen.
|
void |
setCustomEndCap(CustomLineCap value)
Gets or sets a custom cap to use at the end of lines drawn with this
Pen . |
void |
setCustomStartCap(CustomLineCap value)
Gets or sets a custom cap to use at the beginning of lines drawn with this
Pen . |
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 . |
void |
setDashOffset(float value)
Gets or sets the distance from the start of a line to the beginning of a dash pattern.
|
void |
setDashPattern(float[] value)
Gets or sets an array of custom dashes and spaces.
|
void |
setDashStyle(int value)
Gets or sets the style used for dashed lines drawn with this
Pen . |
void |
setEndCap(int value)
Gets or sets the cap style used at the end of lines drawn with this
Pen . |
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 . |
void |
setLineJoin(int value)
Gets or sets the join style for the ends of two consecutive lines drawn with this
Pen . |
void |
setMiterLimit(float value)
Gets or sets the limit of the thickness of the join on a mitered corner.
|
void |
setStartCap(int value)
Gets or sets the cap style used at the beginning of lines drawn with this
Pen . |
void |
setTransform(Matrix value)
Gets or sets a copy of the geometric transformation for this
Pen . |
void |
setWidth(float value)
Gets or sets the width of this
Pen , in units of the Graphics object used for drawing. |
void |
translateTransform(float dx,
float dy)
Translates the local geometric transformation by the specified dimensions.
|
void |
translateTransform(float dx,
float dy,
int order)
Translates the local geometric transformation by the specified dimensions in the specified order.
|
getOpacity, setOpacity
public Pen(Color color)
Initializes a new instance of the Pen
class with the specified color.
color
- A Color
(Pen.getColor()
/Pen.setColor(Color)
) structure that indicates the color of this Pen
.public Pen(Color color, float width)
Initializes a new instance of the Pen
class with the specified Color
(Pen.getColor()
/Pen.setColor(Color)
) and Pen.Width
(Pen.getWidth()
/Pen.setWidth(float)
) properties.
color
- A Color
(Pen.getColor()
/Pen.setColor(Color)
) structure that indicates the color of this Pen
.width
- A value indicating the width of this Pen
.public Pen(Brush brush)
Initializes a new instance of the Pen
class with the specified Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
).
brush
- A Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines the fill properties of this Pen
.com.aspose.ms.System.ArgumentNullException
- brush
is null.public Pen(Brush brush, float width)
Initializes a new instance of the Pen
class with the specified Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) and Pen.Width
(Pen.getWidth()
/Pen.setWidth(float)
).
brush
- A Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines the characteristics of this Pen
.width
- The width of the new Pen
.com.aspose.ms.System.ArgumentNullException
- brush
is null.public final float getWidth()
Gets or sets the width of this Pen
, in units of the Graphics object used for drawing.
com.aspose.ms.System.ArgumentException
- The Pen.Width
(Pen.getWidth()
/Pen.setWidth(float)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: The width of this Pen
.public final void setWidth(float value)
Gets or sets the width of this Pen
, in units of the Graphics object used for drawing.
com.aspose.ms.System.ArgumentException
- The Pen.Width
(Pen.getWidth()
/Pen.setWidth(float)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: The width of this Pen
.public final int getStartCap()
Gets or sets the cap style used at the beginning of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.StartCap
(Pen.getStartCap()
/Pen.setStartCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the LineCap
values that represents the cap style used at the beginning of lines drawn with this Pen
.public final void setStartCap(int value)
Gets or sets the cap style used at the beginning of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.StartCap
(Pen.getStartCap()
/Pen.setStartCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the LineCap
values that represents the cap style used at the beginning of lines drawn with this Pen
.public final int getEndCap()
Gets or sets the cap style used at the end of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.EndCap
(Pen.getEndCap()
/Pen.setEndCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the LineCap
values that represents the cap style used at the end of lines drawn with this Pen
.public final void setEndCap(int value)
Gets or sets the cap style used at the end of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.EndCap
(Pen.getEndCap()
/Pen.setEndCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the LineCap
values that represents the cap style used at the end of lines drawn with this Pen
.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
.
com.aspose.ms.System.ArgumentException
- The Pen.DashCap
(Pen.getDashCap()
/Pen.setDashCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the DashCap
(Pen.getDashCap()
/Pen.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
.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
.
com.aspose.ms.System.ArgumentException
- The Pen.DashCap
(Pen.getDashCap()
/Pen.setDashCap(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: One of the DashCap
(Pen.getDashCap()
/Pen.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
.public final int getLineJoin()
Gets or sets the join style for the ends of two consecutive lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.LineJoin
(Pen.getLineJoin()
/Pen.setLineJoin(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A LineJoin
(Pen.getLineJoin()
/Pen.setLineJoin(int)
) that represents the join style for the ends of two consecutive lines drawn with this Pen
.public final void setLineJoin(int value)
Gets or sets the join style for the ends of two consecutive lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.LineJoin
(Pen.getLineJoin()
/Pen.setLineJoin(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A LineJoin
(Pen.getLineJoin()
/Pen.setLineJoin(int)
) that represents the join style for the ends of two consecutive lines drawn with this Pen
.public final CustomLineCap getCustomStartCap()
Gets or sets a custom cap to use at the beginning of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.CustomStartCap
(Pen.getCustomStartCap()
/Pen.setCustomStartCap(CustomLineCap)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A CustomLineCap
that represents the cap used at the beginning of lines drawn with this Pen
.public final void setCustomStartCap(CustomLineCap value)
Gets or sets a custom cap to use at the beginning of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.CustomStartCap
(Pen.getCustomStartCap()
/Pen.setCustomStartCap(CustomLineCap)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A CustomLineCap
that represents the cap used at the beginning of lines drawn with this Pen
.public final CustomLineCap getCustomEndCap()
Gets or sets a custom cap to use at the end of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.CustomEndCap
(Pen.getCustomEndCap()
/Pen.setCustomEndCap(CustomLineCap)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A CustomLineCap
that represents the cap used at the end of lines drawn with this Pen
.public final void setCustomEndCap(CustomLineCap value)
Gets or sets a custom cap to use at the end of lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.CustomEndCap
(Pen.getCustomEndCap()
/Pen.setCustomEndCap(CustomLineCap)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A CustomLineCap
that represents the cap used at the end of lines drawn with this Pen
.public final float getMiterLimit()
Gets or sets the limit of the thickness of the join on a mitered corner.
com.aspose.ms.System.ArgumentException
- The Pen.MiterLimit
(Pen.getMiterLimit()
/Pen.setMiterLimit(float)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: The limit of the thickness of the join on a mitered corner.public final void setMiterLimit(float value)
Gets or sets the limit of the thickness of the join on a mitered corner.
com.aspose.ms.System.ArgumentException
- The Pen.MiterLimit
(Pen.getMiterLimit()
/Pen.setMiterLimit(float)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: The limit of the thickness of the join on a mitered corner.public final int getAlignment()
Gets or sets the alignment for this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Alignment
(Pen.getAlignment()
/Pen.setAlignment(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A PenAlignment
that represents the alignment for this Pen
.public final void setAlignment(int value)
Gets or sets the alignment for this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Alignment
(Pen.getAlignment()
/Pen.setAlignment(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A PenAlignment
that represents the alignment for this Pen
.public final Matrix getTransform()
Gets or sets a copy of the geometric transformation for this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Transform
(Pen.getTransform()
/Pen.setTransform(Matrix)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A copy of the Matrix
that represents the geometric transformation for this Pen
.public final void setTransform(Matrix value)
Gets or sets a copy of the geometric transformation for this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Transform
(Pen.getTransform()
/Pen.setTransform(Matrix)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A copy of the Matrix
that represents the geometric transformation for this Pen
.public final int getPenType()
Gets the style of lines drawn with this Pen
.
PenType
(Pen.getPenType()
) enumeration that specifies the style of lines drawn with this Pen
.public final Color getColor()
Gets or sets the color of this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Color
(Pen.getColor()
/Pen.setColor(Color)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A Color
(Pen.getColor()
/Pen.setColor(Color)
) structure that represents the color of this Pen
.public final void setColor(Color value)
Gets or sets the color of this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Color
(Pen.getColor()
/Pen.setColor(Color)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A Color
(Pen.getColor()
/Pen.setColor(Color)
) structure that represents the color of this Pen
.public final Brush getBrush()
Gets or sets the Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines attributes of this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines attributes of this Pen
.public final void setBrush(Brush value)
Gets or sets the Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines attributes of this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A Brush
(Pen.getBrush()
/Pen.setBrush(Brush)
) that determines attributes of this Pen
.public final int getDashStyle()
Gets or sets the style used for dashed lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.DashStyle
(Pen.getDashStyle()
/Pen.setDashStyle(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A DashStyle
(Pen.getDashStyle()
/Pen.setDashStyle(int)
) that represents the style used for dashed lines drawn with this Pen
.public final void setDashStyle(int value)
Gets or sets the style used for dashed lines drawn with this Pen
.
com.aspose.ms.System.ArgumentException
- The Pen.DashStyle
(Pen.getDashStyle()
/Pen.setDashStyle(int)
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: A DashStyle
(Pen.getDashStyle()
/Pen.setDashStyle(int)
) that represents the style used for dashed lines drawn with this Pen
.public final float getDashOffset()
Gets or sets the distance from the start of a line to the beginning of a dash pattern.
Value: The distance from the start of a line to the beginning of a dash pattern.public final void setDashOffset(float value)
Gets or sets the distance from the start of a line to the beginning of a dash pattern.
Value: The distance from the start of a line to the beginning of a dash pattern.public final float[] getDashPattern()
Gets or sets an array of custom dashes and spaces.
com.aspose.ms.System.ArgumentException
- The Pen.DashPattern
(Pen.getDashPattern()
/Pen.setDashPattern(float[])
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.public final void setDashPattern(float[] value)
Gets or sets an array of custom dashes and spaces.
com.aspose.ms.System.ArgumentException
- The Pen.DashPattern
(Pen.getDashPattern()
/Pen.setDashPattern(float[])
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.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.
com.aspose.ms.System.ArgumentException
- The Pen.CompoundArray
(Pen.getCompoundArray()
/Pen.setCompoundArray(float[])
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: 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.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.
com.aspose.ms.System.ArgumentException
- The Pen.CompoundArray
(Pen.getCompoundArray()
/Pen.setCompoundArray(float[])
) property is set on an immutable Pen
, such as those returned by the Pen
class.
Value: 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.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
.
startCap
- A LineCap
that represents the cap style to use at the beginning of lines drawn with this Pen
.endCap
- A LineCap
that represents the cap style to use at the end of lines drawn with this Pen
.dashCap
- A LineCap
that represents the cap style to use at the beginning or end of dashed lines drawn with this Pen
.public final void resetTransform()
Resets the geometric transformation matrix for this Pen
to identity.
public final void multiplyTransform(Matrix matrix)
matrix
- The Matrix
object by which to multiply the transformation matrix.public final void multiplyTransform(Matrix matrix, int order)
matrix
- The Matrix
by which to multiply the transformation matrix.order
- The order in which to perform the multiplication operation.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.
dx
- The value of the translation in x.dy
- The value of the translation in y.public final void translateTransform(float dx, float dy, int order)
Translates the local geometric transformation by the specified dimensions in the specified order.
dx
- The value of the translation in x.dy
- The value of the translation in y.order
- The order (prepend or append) in which to apply the translation.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.
sx
- The factor by which to scale the transformation in the x-axis direction.sy
- The factor by which to scale the transformation in the y-axis direction.public final void scaleTransform(float sx, float sy, int order)
Scales the local geometric transformation by the specified factors in the specified order.
sx
- The factor by which to scale the transformation in the x-axis direction.sy
- The factor by which to scale the transformation in the y-axis direction.order
- A MatrixOrder
that specifies whether to append or prepend the scaling matrix.public final void rotateTransform(float angle)
Rotates the local geometric transformation by the specified angle. This method prepends the rotation to the transformation.
angle
- The angle of rotation.public final void rotateTransform(float angle, int order)
Rotates the local geometric transformation by the specified angle in the specified order.
angle
- The angle of rotation.order
- A MatrixOrder
that specifies whether to append or prepend the rotation matrix.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.