com.aspose.imaging
Class GraphicsPath

java.lang.Object
  extended by com.aspose.imaging.ObjectWithBounds
      extended by com.aspose.imaging.GraphicsPath

public final class GraphicsPath
extends ObjectWithBounds

Represents a series of connected lines and curves. This class cannot be inherited.


Constructor Summary
GraphicsPath()
           Initializes a new instance of the GraphicsPath class.
GraphicsPath(Figure[] figures)
           Initializes a new instance of the GraphicsPath class.
GraphicsPath(Figure[] figures, int fillMode)
           Initializes a new instance of the GraphicsPath class.
 
Method Summary
 void addFigure(Figure figure)
           Adds a new figure.
 void addFigures(Figure[] figures)
           Adds new figures.
 void addPath(GraphicsPath addingPath)
           Appends the specified com.aspose.imaging.GraphicsPath to this path.
 void addPath(GraphicsPath addingPath, boolean connect)
           Appends the specified com.aspose.imaging.GraphicsPath to this path.
 GraphicsPath deepClone()
           Performs a deep clone of this graphics path.
 void flatten()
           Converts each curve in this path into a sequence of connected line segments.
 void flatten(Matrix matrix)
           Applies the specified transform and then converts each curve in this com.aspose.imaging.GraphicsPath into a sequence of connected line segments.
 void flatten(Matrix matrix, float flatness)
           Converts each curve in this com.aspose.imaging.GraphicsPath into a sequence of connected line segments.
 RectangleF getBounds()
           Gets or sets the object's bounds.
 RectangleF getBounds(Matrix matrix)
           Gets the object's bounds.
 RectangleF getBounds(Matrix matrix, Pen pen)
           Gets the object's bounds.
 Figure[] getFigures()
           Gets the path figures.
 int getFillMode()
           Gets a com.aspose.imaging.FillMode enumeration that determines how the interiors of shapes in this com.aspose.imaging.GraphicsPath are filled.
 boolean isOutlineVisible(float x, float y, Pen pen)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen.
 boolean isOutlineVisible(float x, float y, Pen pen, Graphics graphics)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.
 boolean isOutlineVisible(int x, int y, Pen pen)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen.
 boolean isOutlineVisible(int x, int y, Pen pen, Graphics graphics)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.
 boolean isOutlineVisible(PointF point, Pen pen)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen.
 boolean isOutlineVisible(PointF pt, Pen pen, Graphics graphics)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.
 boolean isOutlineVisible(Point point, Pen pen)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen.
 boolean isOutlineVisible(Point pt, Pen pen, Graphics graphics)
           Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.
 boolean isVisible(float x, float y)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 boolean isVisible(float x, float y, Graphics graphics)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath in the visible clip region of the specified com.aspose.imaging.Graphics.
 boolean isVisible(int x, int y)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 boolean isVisible(int x, int y, Graphics graphics)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath, using the specified com.aspose.imaging.Graphics.
 boolean isVisible(Point point)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 boolean isVisible(PointF point)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 boolean isVisible(PointF pt, Graphics graphics)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 boolean isVisible(Point pt, Graphics graphics)
           Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.
 void removeFigure(Figure figure)
           Removes a figure.
 void removeFigures(Figure[] figures)
           Removes figures.
 void reset()
           Empties the graphics path and sets the com.aspose.imaging.FillMode to com.aspose.imaging.FillMode.Alternate.
 void reverse()
           Reverses the order of figures, shapes, and points in each shape of this com.aspose.imaging.GraphicsPath.
 void setFillMode(int value)
           Sets a com.aspose.imaging.FillMode enumeration that determines how the interiors of shapes in this com.aspose.imaging.GraphicsPath are filled.
 void transform(Matrix transform)
           Applies the specified transformation to the shape.
 void warp(PointF[] destPoints, RectangleF srcRect)
           Applies a warp transform, defined by a rectangle and a parallelogram, to this com.aspose.imaging.GraphicsPath.
 void warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix)
           Applies a warp transform, defined by a rectangle and a parallelogram, to this com.aspose.imaging.GraphicsPath.
 void warp(PointF[] destPoints, RectangleF srcRect, Matrix matrix, int warpMode)
           Applies a warp transform, defined by a rectangle and a parallelogram, to this com.aspose.imaging.GraphicsPath.
 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 com.aspose.imaging.GraphicsPath.
 void widen(Pen pen)
           Adds an additional outline to the path.
 void widen(Pen pen, Matrix matrix)
           Adds an additional outline to the com.aspose.imaging.GraphicsPath.
 void widen(Pen pen, Matrix matrix, float flatness)
           Replaces this com.aspose.imaging.GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsPath

public GraphicsPath()

Initializes a new instance of the GraphicsPath class.


GraphicsPath

public GraphicsPath(Figure[] figures)

Initializes a new instance of the GraphicsPath class.

Parameters:
figures - The figures to initialize from.

GraphicsPath

public GraphicsPath(Figure[] figures,
                    int fillMode)

Initializes a new instance of the GraphicsPath class.

Parameters:
figures - The figures to initialize from.
fillMode - The fill mode.
Method Detail

addFigure

public void addFigure(Figure figure)

Adds a new figure.

Parameters:
figure - The figure to add.

addFigures

public void addFigures(Figure[] figures)

Adds new figures.

Parameters:
figures - The figures to add.

addPath

public void addPath(GraphicsPath addingPath)

Appends the specified com.aspose.imaging.GraphicsPath to this path.

Parameters:
addingPath - The com.aspose.imaging.GraphicsPath to add.

addPath

public void addPath(GraphicsPath addingPath,
                    boolean connect)

Appends the specified com.aspose.imaging.GraphicsPath to this path.

Parameters:
addingPath - The com.aspose.imaging.GraphicsPath to add.
connect - A 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 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.

deepClone

public GraphicsPath deepClone()

Performs a deep clone of this graphics path.

Returns:
A deep clone of the graphics path.

flatten

public void flatten()

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


flatten

public void flatten(Matrix matrix)

Applies the specified transform and then converts each curve in this com.aspose.imaging.GraphicsPath into a sequence of connected line segments.

Parameters:
matrix - A com.aspose.imaging.Matrix by which to transform this com.aspose.imaging.GraphicsPath before flattening.

flatten

public void flatten(Matrix matrix,
                    float flatness)

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

Parameters:
matrix - A com.aspose.imaging.Matrix by which to transform this com.aspose.imaging.GraphicsPath before flattening.
flatness - Specifies 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.

getBounds

public RectangleF getBounds()

Gets or sets the object's bounds.

Value: The object's bounds.

Specified by:
getBounds in class ObjectWithBounds

getBounds

public RectangleF getBounds(Matrix matrix)

Gets the object's bounds.

Specified by:
getBounds in class ObjectWithBounds
Parameters:
matrix - The matrix to apply before bounds will be calculated.
Returns:
The estimated object's bounds.

getBounds

public RectangleF getBounds(Matrix matrix,
                            Pen pen)

Gets the object's bounds.

Specified by:
getBounds in class ObjectWithBounds
Parameters:
matrix - The matrix to apply before bounds will be calculated.
pen - The pen to use for object. This can influence the object's bounds size.
Returns:
The estimated object's bounds.

getFigures

public Figure[] getFigures()

Gets the path figures.

Value: The path figures.


getFillMode

public int getFillMode()

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

Returns:
A com.aspose.imaging.FillMode enumeration that specifies how the interiors of shapes in this com.aspose.imaging.GraphicsPath are filled. Value: The fill mode.<PermissionSet><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"></IPermission></PermissionSet>

isOutlineVisible

public boolean isOutlineVisible(float x,
                                float y,
                                Pen pen)

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

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
pen - The com.aspose.imaging.Pen to test.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(float x,
                                float y,
                                Pen pen,
                                Graphics graphics)

Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
pen - The com.aspose.imaging.Pen to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath as drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(int x,
                                int y,
                                Pen pen)

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

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
pen - The com.aspose.imaging.Pen to test.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(int x,
                                int y,
                                Pen pen,
                                Graphics graphics)

Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
pen - The com.aspose.imaging.Pen to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath as drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(PointF point,
                                Pen pen)

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

Parameters:
point - A com.aspose.imaging.PointF that specifies the location to test.
pen - The com.aspose.imaging.Pen to test.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(PointF pt,
                                Pen pen,
                                Graphics graphics)

Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.

Parameters:
pt - A com.aspose.imaging.PointF that specifies the location to test.
pen - The com.aspose.imaging.Pen to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath as drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(Point point,
                                Pen pen)

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

Parameters:
point - A com.aspose.imaging.Point that specifies the location to test.
pen - The com.aspose.imaging.Pen to test.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isOutlineVisible

public boolean isOutlineVisible(Point pt,
                                Pen pen,
                                Graphics graphics)

Indicates whether the specified point is contained within (under) the outline of this com.aspose.imaging.GraphicsPath when drawn with the specified com.aspose.imaging.Pen and using the specified com.aspose.imaging.Graphics.

Parameters:
pt - A com.aspose.imaging.Point that specifies the location to test.
pen - The com.aspose.imaging.Pen to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within the outline of this com.aspose.imaging.GraphicsPath as drawn with the specified com.aspose.imaging.Pen; otherwise, false.

isVisible

public boolean isVisible(float x,
                         float y)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

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

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath in the visible clip region of the specified com.aspose.imaging.Graphics.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

public boolean isVisible(int x,
                         int y)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

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

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

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

public boolean isVisible(Point point)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
point - A com.aspose.imaging.Point that represents the point to test.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

public boolean isVisible(PointF point)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
point - A com.aspose.imaging.PointF that represents the point to test.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

isVisible

public boolean isVisible(PointF pt,
                         Graphics graphics)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
pt - A com.aspose.imaging.PointF that represents the point to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within this; otherwise, false.

isVisible

public boolean isVisible(Point pt,
                         Graphics graphics)

Indicates whether the specified point is contained within this com.aspose.imaging.GraphicsPath.

Parameters:
pt - A com.aspose.imaging.Point that represents the point to test.
graphics - The com.aspose.imaging.Graphics for which to test visibility.
Returns:
This method returns true if the specified point is contained within this com.aspose.imaging.GraphicsPath; otherwise, false.

removeFigure

public void removeFigure(Figure figure)

Removes a figure.

Parameters:
figure - The figure to remove.

removeFigures

public void removeFigures(Figure[] figures)

Removes figures.

Parameters:
figures - The figures to remove.

reset

public void reset()

Empties the graphics path and sets the com.aspose.imaging.FillMode to com.aspose.imaging.FillMode.Alternate.


reverse

public void reverse()

Reverses the order of figures, shapes, and points in each shape of this com.aspose.imaging.GraphicsPath.


setFillMode

public void setFillMode(int value)

Sets a com.aspose.imaging.FillMode enumeration that determines how the interiors of shapes in this com.aspose.imaging.GraphicsPath are filled.


transform

public void transform(Matrix transform)

Applies the specified transformation to the shape.

Specified by:
transform in class ObjectWithBounds
Parameters:
transform - The transformation to apply.

warp

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

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

Parameters:
destPoints - An array of com.aspose.imaging.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.
srcRect - A com.aspose.imaging.RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.

warp

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

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

Parameters:
destPoints - An array of com.aspose.imaging.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.
srcRect - A com.aspose.imaging.RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrix - A com.aspose.imaging.Matrix that specifies a geometric transform to apply to the path.

warp

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

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

Parameters:
destPoints - An array of com.aspose.imaging.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.
srcRect - A com.aspose.imaging.RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrix - A com.aspose.imaging.Matrix that specifies a geometric transform to apply to the path.
warpMode - A com.aspose.imaging.WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode.

warp

public 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 com.aspose.imaging.GraphicsPath.

Parameters:
destPoints - An array of com.aspose.imaging.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.
srcRect - A com.aspose.imaging.RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints.
matrix - A com.aspose.imaging.Matrix that specifies a geometric transform to apply to the path.
warpMode - A com.aspose.imaging.WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode.
flatness - A value from 0 through 1 that specifies how flat the resulting path is. For more information, see the GraphicsPath.Flatten methods.

widen

public void widen(Pen pen)

Adds an additional outline to the path.

Parameters:
pen - A com.aspose.imaging.Pen that specifies the width between the original outline of the path and the new outline this method creates.

widen

public void widen(Pen pen,
                  Matrix matrix)

Adds an additional outline to the com.aspose.imaging.GraphicsPath.

Parameters:
pen - A com.aspose.imaging.Pen that specifies the width between the original outline of the path and the new outline this method creates.
matrix - A com.aspose.imaging.Matrix that specifies a transform to apply to the path before widening.

widen

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

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

Parameters:
pen - A com.aspose.imaging.Pen that specifies the width between the original outline of the path and the new outline this method creates.
matrix - A com.aspose.imaging.Matrix that specifies a transform to apply to the path before widening.
flatness - A value that specifies the flatness for curves.