GraphicsPath

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public class GraphicsPath implements System.IDisposable

Represents a series of connected lines and curves.

Constructors

ConstructorDescription
GraphicsPath()Initializes a new instance of the GraphicsPath class with a FillMode value of Alternate.
GraphicsPath(int fillMode)Initializes a new instance of the GraphicsPath class with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration.
GraphicsPath(PointF[] pts, byte[] types)Initializes a new instance of the GraphicsPath class with the specified PathPointType and PointF arrays.
GraphicsPath(Point[] pts, byte[] types)Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays.
GraphicsPath(PointF[] pts, byte[] types, int fillMode)Initializes a new instance of the GraphicsPath class with the specified PathPointType and PointF arrays and with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration element..
GraphicsPath(Point[] pts, byte[] types, int fillMode)Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays and with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration element..

Methods

MethodDescription
getFillMode()Gets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.
setFillMode(int value)Gets or sets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.
getPathData()Gets a PathData that encapsulates arrays of points and types for this GraphicsPath
getPointCount()Gets the number of elements in the PathPoints or the PathTypes array.
getPathTypes()Gets the types of the corresponding points in the PathPoints array.
getPathPoints()Gets the points in the path.
dispose()Releases all resources used by this GraphicsPath.
deepClone()Make a copy of the current path object.
addArc(RectangleF rect, float startAngle, float sweepAngle)Appends an elliptical arc to the current figure.
addArc(float x, float y, float width, float height, float startAngle, float sweepAngle)Appends an elliptical arc to the current figure.
addBezier(PointF pt1, PointF pt2, PointF pt3, PointF pt4)Adds a cubic Bzier curve to the current figure.
addBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)Adds a cubic Bzier curve to the current figure.
addBeziers(Point[] points)Adds a sequence of connected cubic Bzier curves to the current figure.
addBeziers(PointF[] points)Adds a sequence of connected cubic Bzier curves to the current figure.
addClosedCurve(PointF[] points)Adds a closed curve to this path.
addClosedCurve(PointF[] points, float tension)Adds a closed curve to this path.
addCurve(Point[] points)Adds a spline curve to the current figure.
addCurve(PointF[] points)Adds a spline curve to the current figure.
addCurve(PointF[] points, float tension)Adds a spline curve to the current figure.
addCurve(PointF[] points, int offset, int numberOfSegments, float tension)Adds a spline curve to the current figure.
addEllipse(RectangleF rect)Adds an ellipse to the current path.
addEllipse(float x, float y, float width, float height)Adds an ellipse to the current path.
addLine(PointF pt1, PointF pt2)Appends a line segment to this GraphicsPath.
addLine(float x1, float y1, float x2, float y2)Appends a line segment to this GraphicsPath.
addLines(PointF[] points)Appends a series of connected line segments to the end of this GraphicsPath.
addLines(Point[] points)Appends a series of connected line segments to the end of this GraphicsPath.
addPath(GraphicsPath addingPath, boolean connect)Appends the specified GraphicsPath to this path.
addPie(Rectangle rect, float startAngle, float sweepAngle)Adds the outline of a pie shape to this path.
addPie(float x, float y, float width, float height, float startAngle, float sweepAngle)Adds the outline of a pie shape to this path.
addPolygon(PointF[] points)Adds a polygon to this path.
addPolygon(Point[] points)Adds a polygon to this path.
addRectangle(Rectangle rect)Adds a rectangle to this path.
addRectangle(RectangleF rect)Adds a rectangle to this path.
addRectangles(RectangleF[] rects)Adds a series of rectangles to this path.
addRectangles(Rectangle[] rects)Adds a series of rectangles to this path.
addString(String s, FontFamily family, int style, float emSize, Point origin, StringFormat format)Adds a text string to this path.
addString(String s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)Adds a text string to this path.
addString(String s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)Adds a text string to this path.
addString(String s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)Adds a text string to this path.
startFigure()Starts a new figure without closing the current figure.
closeFigure()Closes the current figure and starts a new figure.
transform(Matrix matrix)Applies a transform matrix to this GraphicsPath.
getBounds()Returns a rectangle that bounds this GraphicsPath.
getBounds(Matrix matrix)Returns a rectangle that bounds this GraphicsPath when this path is transformed by the specified Matrix.
getBounds(Matrix matrix, Pen pen)Returns a rectangle that bounds this GraphicsPath when the current path is transformed by the specified Matrix and drawn with the specified Pen.
getLastPoint()Gets the last point in the PathPoints array of this GraphicsPath.
flatten()Converts each curve in this path into a sequence of connected line segments.
flatten(Matrix matrix)Applies the specified transform and then converts each curve in this GraphicsPath.
flatten(Matrix matrix, float flatness)Converts each curve in this GraphicsPath into a sequence of connected line segments.
widen(Pen pen)Adds an additional outline to the path.
widen(Pen pen, Matrix matrix)Adds an additional outline to the GraphicsPath.
widen(Pen pen, Matrix matrix, float flatness)Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.
closeAllFigures()Closes all open figures in this path and starts a new figure.
reset()Empties the Drawing2D.GraphicsPath.PathPoints(.getPathPoints) and Drawing2D.GraphicsPath.PathTypes(.getPathTypes) arrays and sets the FillMode to System.Drawing.Drawing2D.FillMode.Alternate.
reverse()Reverses the order of points in the Drawing2D.GraphicsPath.PathPoints(.getPathPoints) array of this GraphicsPath.
setMarkers()Sets a marker on this GraphicsPath.
isOutlineVisible(PointF point, Pen pen)Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
isVisible(float x, float y)Indicates whether the specified point is contained within this GraphicsPath.
isVisible(float x, float y, Graphics graphics)Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.
isVisible(int x, int y)Indicates whether the specified point is contained within this GraphicsPath.
isVisible(int x, int y, Graphics graphics)Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.
isVisible(Point point)Indicates whether the specified point is contained within this GraphicsPath.
isVisible(Point point, Graphics graphics)Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.
isVisible(PointF point)Indicates whether the specified point is contained within this GraphicsPath.
isVisible(PointF point, Graphics graphics)Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.
warp(PointF[] destPoints, RectangleF srcRect)Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix)Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode)Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode, float flatness)Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
getFigures()Gets the path figures.

GraphicsPath()

public GraphicsPath()

Initializes a new instance of the GraphicsPath class with a FillMode value of Alternate.

GraphicsPath(int fillMode)

public GraphicsPath(int fillMode)

Initializes a new instance of the GraphicsPath class with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration.

Parameters:

ParameterTypeDescription
fillModeintThe FillMode(.getFillMode/.setFillMode(int)) enumeration that determines how the interior of this GraphicsPath is filled.

GraphicsPath(PointF[] pts, byte[] types)

public GraphicsPath(PointF[] pts, byte[] types)

Initializes a new instance of the GraphicsPath class with the specified PathPointType and PointF arrays.

Parameters:

ParameterTypeDescription
ptsPointF[]An array of PointF structures that defines the coordinates of the points that make up this GraphicsPath.
typesbyte[]An array of PathPointType enumeration elements that specifies the type of each corresponding point in the pts array.

This method actually does nothing. It’s just for compatibility with System.Drawing API. |

GraphicsPath(Point[] pts, byte[] types)

public GraphicsPath(Point[] pts, byte[] types)

Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays.

Parameters:

ParameterTypeDescription
ptsPoint[]An array of Point structures that defines the coordinates of the points that make up this GraphicsPath.
typesbyte[]An array of PathPointType enumeration elements that specifies the type of each corresponding point in the pts array.

This method actually does nothing. It’s just for compatibility with System.Drawing API. |

GraphicsPath(PointF[] pts, byte[] types, int fillMode)

public GraphicsPath(PointF[] pts, byte[] types, int fillMode)

Initializes a new instance of the GraphicsPath class with the specified PathPointType and PointF arrays and with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration element..

Parameters:

ParameterTypeDescription
ptsPointF[]An array of PointF structures that defines the coordinates of the points that make up this GraphicsPath.
typesbyte[]An array of PathPointType enumeration elements that specifies the type of each corresponding point in the pts array.
fillModeintA FillMode(.getFillMode/.setFillMode(int)) enumeration that specifies how the interiors of shapes in this GraphicsPath are filled.

GraphicsPath(Point[] pts, byte[] types, int fillMode)

public GraphicsPath(Point[] pts, byte[] types, int fillMode)

Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays and with the specified FillMode(.getFillMode/.setFillMode(int)) enumeration element..

Parameters:

ParameterTypeDescription
ptsPoint[]An array of Point structures that defines the coordinates of the points that make up this GraphicsPath.
typesbyte[]An array of PathPointType enumeration elements that specifies the type of each corresponding point in the pts array.
fillModeintA FillMode(.getFillMode/.setFillMode(int)) enumeration that specifies how the interiors of shapes in this GraphicsPath are filled.

getFillMode()

public final int getFillMode()

Gets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.

Returns: int - a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.

setFillMode(int value)

public final void setFillMode(int value)

Gets or sets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.

Parameters:

ParameterTypeDescription
valueint

getPathData()

public final PathData getPathData()

Gets a PathData that encapsulates arrays of points and types for this GraphicsPath

Value: A PathData that encapsulates arrays for both the points and types for this GraphicsPath.

Returns: PathData

getPointCount()

public final int getPointCount()

Gets the number of elements in the PathPoints or the PathTypes array.

Returns: int - An integer that specifies the number of elements in the PathPoints or the PathTypes array.

getPathTypes()

public final byte[] getPathTypes()

Gets the types of the corresponding points in the PathPoints array.

Returns: byte[]

getPathPoints()

public final PointF[] getPathPoints()

Gets the points in the path.

Returns: com.aspose.drawing.PointF[] - An array of PointF objects that represent the path.

dispose()

public final void dispose()

Releases all resources used by this GraphicsPath.


This method actually does nothing. It’s just for compatibility with System.Drawing API.

deepClone()

public final Object deepClone()

Make a copy of the current path object.

Returns: java.lang.Object

addArc(RectangleF rect, float startAngle, float sweepAngle)

public final void addArc(RectangleF rect, float startAngle, float sweepAngle)

Appends an elliptical arc to the current figure.

Parameters:

ParameterTypeDescription
rectRectangleFA RectangleF that represents the rectangular bounds of the ellipse from which the arc is taken.
startAnglefloatThe starting angle of the arc, measured in degrees clockwise from the x-axis.
sweepAnglefloatThe angle between startAngle and the end of the arc.

addArc(float x, float y, float width, float height, float startAngle, float sweepAngle)

public final void addArc(float x, float y, float width, float height, float startAngle, float sweepAngle)

Appends an elliptical arc to the current figure.

Parameters:

ParameterTypeDescription
xfloatThe x coordinate.
yfloatThe y coordinate.
widthfloatThe width.
heightfloatThe height.
startAnglefloatThe start angle.
sweepAnglefloatThe sweep angle.

addBezier(PointF pt1, PointF pt2, PointF pt3, PointF pt4)

public final void addBezier(PointF pt1, PointF pt2, PointF pt3, PointF pt4)

Adds a cubic Bzier curve to the current figure.

Parameters:

ParameterTypeDescription
pt1PointFA PointF that represents the starting point of the curve.
pt2PointFA PointF that represents the first control point for the curve.
pt3PointFA PointF that represents the second control point for the curve.
pt4PointFA PointF that represents the endpoint of the curve.

addBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

public final void addBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

Adds a cubic Bzier curve to the current figure.

Parameters:

ParameterTypeDescription
x1floatThe x-coordinate of the starting point of the curve.
y1floatThe y-coordinate of the starting point of the curve.
x2floatThe x-coordinate of the first control point for the curve.
y2floatThe y-coordinate of the first control point for the curve.
x3floatThe x-coordinate of the second control point for the curve.
y3floatThe y-coordinate of the second control point for the curve.
x4floatThe x-coordinate of the endpoint of the curve.
y4floatThe y-coordinate of the endpoint of the curve.

addBeziers(Point[] points)

public final void addBeziers(Point[] points)

Adds a sequence of connected cubic Bzier curves to the current figure.

Parameters:

ParameterTypeDescription
pointsPoint[]The points.

addBeziers(PointF[] points)

public final void addBeziers(PointF[] points)

Adds a sequence of connected cubic Bzier curves to the current figure.

Parameters:

ParameterTypeDescription
pointsPointF[]The points.

addClosedCurve(PointF[] points)

public final void addClosedCurve(PointF[] points)

Adds a closed curve to this path. A cardinal spline curve is used because the curve travels through each of the points in the array.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the curve.

addClosedCurve(PointF[] points, float tension)

public final void addClosedCurve(PointF[] points, float tension)

Adds a closed curve to this path. A cardinal spline curve is used because the curve travels through each of the points in the array.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the curve.
tensionfloatA value between from 0 through 1 that specifies the amount that the curve bends between points, with 0 being the smallest curve (sharpest corner) and 1 being the smoothest curve.

addCurve(Point[] points)

public final void addCurve(Point[] points)

Adds a spline curve to the current figure. A cardinal spline curve is used because the curve travels through each of the points in the array.

Parameters:

ParameterTypeDescription
pointsPoint[]An array of Point structures that represents the points that define the curve.

addCurve(PointF[] points)

public final void addCurve(PointF[] points)

Adds a spline curve to the current figure. A cardinal spline curve is used because the curve travels through each of the points in the array.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the curve.

addCurve(PointF[] points, float tension)

public final void addCurve(PointF[] points, float tension)

Adds a spline curve to the current figure.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the curve.
tensionfloatA value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.

addCurve(PointF[] points, int offset, int numberOfSegments, float tension)

public final void addCurve(PointF[] points, int offset, int numberOfSegments, float tension)

Adds a spline curve to the current figure.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the curve.
offsetintThe index of the element in the points array that is used as the first point in the curve.
numberOfSegmentsintThe number of segments used to draw the curve. A segment can be thought of as a line connecting two points.
tensionfloatA value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.

addEllipse(RectangleF rect)

public final void addEllipse(RectangleF rect)

Adds an ellipse to the current path.

Parameters:

ParameterTypeDescription
rectRectangleFA RectangleF that represents the bounding rectangle that defines the ellipse.

addEllipse(float x, float y, float width, float height)

public final void addEllipse(float x, float y, float width, float height)

Adds an ellipse to the current path.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
yfloatThe y-coordinate of the upper left corner of the bounding rectangle that defines the ellipse.
widthfloatThe width of the bounding rectangle that defines the ellipse.
heightfloatThe height of the bounding rectangle that defines the ellipse.

addLine(PointF pt1, PointF pt2)

public final void addLine(PointF pt1, PointF pt2)

Appends a line segment to this GraphicsPath.

Parameters:

ParameterTypeDescription
pt1PointFA PointF that represents the starting point of the line.
pt2PointFA PointF that represents the endpoint of the line.

addLine(float x1, float y1, float x2, float y2)

public final void addLine(float x1, float y1, float x2, float y2)

Appends a line segment to this GraphicsPath.

Parameters:

ParameterTypeDescription
x1floatThe x-coordinate of the starting point of the line.
y1floatThe y-coordinate of the starting point of the line.
x2floatThe x-coordinate of the endpoint of the line.
y2floatThe y-coordinate of the endpoint of the line.

addLines(PointF[] points)

public final void addLines(PointF[] points)

Appends a series of connected line segments to the end of this GraphicsPath.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that represents the points that define the line segments to add.

addLines(Point[] points)

public final void addLines(Point[] points)

Appends a series of connected line segments to the end of this GraphicsPath.

Parameters:

ParameterTypeDescription
pointsPoint[]An array of Point structures that represents the points that define the line segments to add.

addPath(GraphicsPath addingPath, boolean connect)

public final void addPath(GraphicsPath addingPath, boolean connect)

Appends the specified GraphicsPath to this path.

Parameters:

ParameterTypeDescription
addingPathGraphicsPathThe GraphicsPath to add.
connectbooleanA Boolean value that specifies whether the first figure in the added path is part of the last figure in this path. A value of true specifies that (if possible) the first figure in the added path is part of the last figure in this path. A value of false specifies that the first figure in the added path is separate from the last figure in this path.

addPie(Rectangle rect, float startAngle, float sweepAngle)

public final void addPie(Rectangle rect, float startAngle, float sweepAngle)

Adds the outline of a pie shape to this path.

Parameters:

ParameterTypeDescription
rectRectangleA Rectangle that represents the bounding rectangle that defines the ellipse from which the pie is drawn.
startAnglefloatThe starting angle for the pie section, measured in degrees clockwise from the x-axis.
sweepAnglefloatThe angle between startAngle and the end of the pie section, measured in degrees clockwise from startAngle.

addPie(float x, float y, float width, float height, float startAngle, float sweepAngle)

public final void addPie(float x, float y, float width, float height, float startAngle, float sweepAngle)

Adds the outline of a pie shape to this path.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie is drawn.
yfloatThe y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie is drawn.
widthfloatThe width of the bounding rectangle that defines the ellipse from which the pie is drawn.
heightfloatThe height of the bounding rectangle that defines the ellipse from which the pie is drawn.
startAnglefloatThe starting angle for the pie section, measured in degrees clockwise from the x-axis.
sweepAnglefloatThe angle between startAngle and the end of the pie section, measured in degrees clockwise from startAngle.

addPolygon(PointF[] points)

public final void addPolygon(PointF[] points)

Adds a polygon to this path.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of PointF structures that defines the polygon to add.

addPolygon(Point[] points)

public final void addPolygon(Point[] points)

Adds a polygon to this path.

Parameters:

ParameterTypeDescription
pointsPoint[]An array of Point structures that defines the polygon to add.

addRectangle(Rectangle rect)

public final void addRectangle(Rectangle rect)

Adds a rectangle to this path.

Parameters:

ParameterTypeDescription
rectRectangleA Rectangle that represents the rectangle to add.

addRectangle(RectangleF rect)

public final void addRectangle(RectangleF rect)

Adds a rectangle to this path.

Parameters:

ParameterTypeDescription
rectRectangleFA RectangleF that represents the rectangle to add.

addRectangles(RectangleF[] rects)

public final void addRectangles(RectangleF[] rects)

Adds a series of rectangles to this path.

Parameters:

ParameterTypeDescription
rectsRectangleF[]An array of RectangleF structures that represents the rectangles to add.

addRectangles(Rectangle[] rects)

public final void addRectangles(Rectangle[] rects)

Adds a series of rectangles to this path.

Parameters:

ParameterTypeDescription
rectsRectangle[]An array of Rectangle structures that represents the rectangles to add.

addString(String s, FontFamily family, int style, float emSize, Point origin, StringFormat format)

public final void addString(String s, FontFamily family, int style, float emSize, Point origin, StringFormat format)

Adds a text string to this path.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe String to add.
familyFontFamilyA FontFamily that represents the name of the font with which the test is drawn.
styleintA FontStyle enumeration that represents style information about the text (bold, italic, and so on). This must be cast as an integer (see the example code later in this section).
emSizefloatThe height of the EM square box that bounds the character.
originPointA Point that represents the point where the text starts.
formatStringFormatA StringFormat that specifies text formatting information, such as line spacing and alignment.

addString(String s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)

public final void addString(String s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)

Adds a text string to this path.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe String to add.
familyFontFamilyA FontFamily that represents the name of the font with which the test is drawn.
styleintA FontStyle enumeration that represents style information about the text (bold, italic, and so on). This must be cast as an integer (see the example code later in this section).
emSizefloatThe height of the EM square box that bounds the character.
originPointFA PointF that represents the point where the text starts.
formatStringFormatA StringFormat that specifies text formatting information, such as line spacing and alignment.

addString(String s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)

public final void addString(String s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)

Adds a text string to this path.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe String to add.
familyFontFamilyA FontFamily that represents the name of the font with which the test is drawn.
styleintA FontStyle enumeration that represents style information about the text (bold, italic, and so on). This must be cast as an integer (see the example code later in this section).
emSizefloatThe height of the EM square box that bounds the character.
layoutRectRectangleA Rectangle that represents the rectangle that bounds the text.
formatStringFormatA StringFormat that specifies text formatting information, such as line spacing and alignment.

addString(String s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)

public final void addString(String s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)

Adds a text string to this path.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe String to add.
familyFontFamilyA FontFamily that represents the name of the font with which the test is drawn.
styleintA FontStyle enumeration that represents style information about the text (bold, italic, and so on). This must be cast as an integer (see the example code later in this section).
emSizefloatThe height of the EM square box that bounds the character.
layoutRectRectangleFA RectangleF that represents the rectangle that bounds the text.
formatStringFormatA StringFormat that specifies text formatting information, such as line spacing and alignment.

startFigure()

public final void startFigure()

Starts a new figure without closing the current figure. All subsequent points added to the path are added to this new figure.

closeFigure()

public final void closeFigure()

Closes the current figure and starts a new figure. If the current figure contains a sequence of connected lines and curves, the method closes the loop by connecting a line from the endpoint to the starting point.

transform(Matrix matrix)

public final void transform(Matrix matrix)

Applies a transform matrix to this GraphicsPath.

Parameters:

ParameterTypeDescription
matrixMatrixA Matrix that represents the transformation to apply.

getBounds()

public final RectangleF getBounds()

Returns a rectangle that bounds this GraphicsPath.

Returns: RectangleF - A RectangleF that represents a rectangle that bounds this GraphicsPath.

getBounds(Matrix matrix)

public final RectangleF getBounds(Matrix matrix)

Returns a rectangle that bounds this GraphicsPath when this path is transformed by the specified Matrix.

Parameters:

ParameterTypeDescription
matrixMatrixThe Matrix that specifies a transformation to be applied to this path before the bounding rectangle is calculated. This path is not permanently transformed; the transformation is used only during the process of calculating the bounding rectangle.

Returns: RectangleF - A RectangleF that represents a rectangle that bounds this GraphicsPath.

getBounds(Matrix matrix, Pen pen)

public final RectangleF getBounds(Matrix matrix, Pen pen)

Returns a rectangle that bounds this GraphicsPath when the current path is transformed by the specified Matrix and drawn with the specified Pen.

Parameters:

ParameterTypeDescription
matrixMatrixThe Matrix that specifies a transformation to be applied to this path before the bounding rectangle is calculated. This path is not permanently transformed; the transformation is used only during the process of calculating the bounding rectangle.
penPenThe Pen with which to draw the GraphicsPath.

Returns: RectangleF - A RectangleF that represents a rectangle that bounds this GraphicsPath.

getLastPoint()

public final PointF getLastPoint()

Gets the last point in the PathPoints array of this GraphicsPath.

Returns: PointF - The last point in the PathPoints array of this GraphicsPath.

flatten()

public final void flatten()

Converts each curve in this path into a sequence of connected line segments.

flatten(Matrix matrix)

public final void flatten(Matrix matrix)

Applies the specified transform and then converts each curve in this GraphicsPath.

Parameters:

ParameterTypeDescription
matrixMatrixA Matrix by which to transform this GraphicsPath before flattening.

flatten(Matrix matrix, float flatness)

public final void flatten(Matrix matrix, float flatness)

Converts each curve in this GraphicsPath into a sequence of connected line segments.

Parameters:

ParameterTypeDescription
matrixMatrixA Matrix by which to transform this GraphicsPath before flattening.
flatnessfloatSpecifies the maximum permitted error between the curve and its flattened approximation. A value of 0.25 is the default. Reducing the flatness value will increase the number of line segments in the approximation.

widen(Pen pen)

public final void widen(Pen pen)

Adds an additional outline to the path.

Parameters:

ParameterTypeDescription
penPenA Pen that specifies the width between the original outline of the path and the new outline this method creates.

widen(Pen pen, Matrix matrix)

public final void widen(Pen pen, Matrix matrix)

Adds an additional outline to the GraphicsPath.

Parameters:

ParameterTypeDescription
penPenA Pen that specifies the width between the original outline of the path and the new outline this method creates.
matrixMatrixA Matrix that specifies a transform to apply to the path before widening.

widen(Pen pen, Matrix matrix, float flatness)

public final void widen(Pen pen, Matrix matrix, float flatness)

Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.

Parameters:

ParameterTypeDescription
penPenA Pen that specifies the width between the original outline of the path and the new outline this method creates.
matrixMatrixA Matrix that specifies a transform to apply to the path before widening.
flatnessfloatA value that specifies the flatness for curves.

MS System.Drawing implementation calls Flatten() inside Widen() or uses the same algorithm. Aspose.Drawing implementation uses Skia algorithm without replacement the curves to line segments. It ignores the flatness parameter. |

closeAllFigures()

public final void closeAllFigures()

Closes all open figures in this path and starts a new figure. It closes each open figure by connecting a line from its endpoint to its starting point.

reset()

public final void reset()

Empties the Drawing2D.GraphicsPath.PathPoints(.getPathPoints) and Drawing2D.GraphicsPath.PathTypes(.getPathTypes) arrays and sets the FillMode to System.Drawing.Drawing2D.FillMode.Alternate.

reverse()

public final void reverse()

Reverses the order of points in the Drawing2D.GraphicsPath.PathPoints(.getPathPoints) array of this GraphicsPath.

setMarkers()

public final void setMarkers()

Sets a marker on this GraphicsPath.

isOutlineVisible(PointF point, Pen pen)

public final boolean isOutlineVisible(PointF point, Pen pen)

Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

Parameters:

ParameterTypeDescription
pointPointFA PointF that specifies the location to test.
penPenThe Pen to test.

Returns: boolean - This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false.

isVisible(float x, float y)

public final boolean isVisible(float x, float y)

Indicates whether the specified point is contained within this GraphicsPath.

Parameters:

ParameterTypeDescription
xfloatThe X coordinate of the point to test.
yfloatThe Y coordinate of the point to test.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(float x, float y, Graphics graphics)

public final boolean isVisible(float x, float y, Graphics graphics)

Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.

Parameters:

ParameterTypeDescription
xfloatThe X coordinate of the point to test.
yfloatThe Y coordinate of the point to test.
graphicsGraphicsThe GraphicsPath for which to test visibility.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(int x, int y)

public final boolean isVisible(int x, int y)

Indicates whether the specified point is contained within this GraphicsPath.

Parameters:

ParameterTypeDescription
xintThe X coordinate of the point to test.
yintThe Y coordinate of the point to test.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(int x, int y, Graphics graphics)

public final boolean isVisible(int x, int y, Graphics graphics)

Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.

Parameters:

ParameterTypeDescription
xintThe X coordinate of the point to test.
yintThe Y coordinate of the point to test.
graphicsGraphicsThe GraphicsPath for which to test visibility.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(Point point)

public final boolean isVisible(Point point)

Indicates whether the specified point is contained within this GraphicsPath.

Parameters:

ParameterTypeDescription
pointPointA Point that represents the point to test.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(Point point, Graphics graphics)

public final boolean isVisible(Point point, Graphics graphics)

Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.

Parameters:

ParameterTypeDescription
pointPointA Point that represents the point to test.
graphicsGraphicsThe GraphicsPath for which to test visibility.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(PointF point)

public final boolean isVisible(PointF point)

Indicates whether the specified point is contained within this GraphicsPath.

Parameters:

ParameterTypeDescription
pointPointFA PointF that represents the point to test.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

isVisible(PointF point, Graphics graphics)

public final boolean isVisible(PointF point, Graphics graphics)

Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.

Parameters:

ParameterTypeDescription
pointPointFA PointF that represents the point to test.
graphicsGraphicsThe GraphicsPath for which to test visibility.

Returns: boolean - This method returns true if the specified point is contained within this GraphicsPath; otherwise, false.

warp(PointF[] destPoints, RectangleF srcRect)

public final void warp(PointF[] destPoints, RectangleF srcRect)

Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Parameters:

ParameterTypeDescription
destPointsPointF[]An array of PointF structures that define a parallelogram to which the rectangle defined by srcRect is transformed. The array can contain either three or four elements. If the array contains three elements, the lower-right corner of the parallelogram is implied by the first three points.
srcRectRectangleFA RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.

warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix)

public final void warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix)

Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Parameters:

ParameterTypeDescription
destPointsPointF[]An array of PointF structures that define a parallelogram to which the rectangle defined by srcRect is transformed. The array can contain either three or four elements. If the array contains three elements, the lower-right corner of the parallelogram is implied by the first three points.
srcRectRectangleFA RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrixMatrixA Matrix that specifies a geometric transform to apply to the path.

warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode)

public final void warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode)

Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Parameters:

ParameterTypeDescription
destPointsPointF[]An array of PointF structures that defines a parallelogram to which the rectangle defined by srcRect is transformed. The array can contain either three or four elements. If the array contains three elements, the lower-right corner of the parallelogram is implied by the first three points.
srcRectRectangleFA RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrixMatrixA Matrix that specifies a geometric transform to apply to the path.
warpModeintA WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode.

warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode, float flatness)

public final void warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode, float flatness)

Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Parameters:

ParameterTypeDescription
destPointsPointF[]An array of PointF structures that define a parallelogram to which the rectangle defined by srcRect is transformed. The array can contain either three or four elements. If the array contains three elements, the lower-right corner of the parallelogram is implied by the first three points.
srcRectRectangleFA RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrixMatrixA Matrix that specifies a geometric transform to apply to the path.
warpModeintA WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode.
flatnessfloatA value from 0 through 1 that specifies how flat the resulting path is. For more information, see the M:System.Drawing.Drawing2D.GraphicsPath.Flatten methods.

getFigures()

public Figure[] getFigures()

Gets the path figures.

Returns: com.aspose.imaging.Figure[] - The path figures.