GraphicsPath Class
Summary: Represents a series of connected lines and curves. This class cannot be inherited.
Module: aspose.imaging
Full Name: aspose.imaging.GraphicsPath
Inheritance: ObjectWithBounds
Constructors
Name | Description |
---|---|
GraphicsPath() | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(figures) | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(figures, fill_mode) | Initializes a new instance of the GraphicsPath class. |
GraphicsPath(fill_mode) | Initializes a new instance of the GraphicsPath class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
bounds | RectangleF | r | Gets or sets the object’s bounds. |
figures | Figure[] | r | Gets the path figures. |
fill_mode | FillMode | r/w | Gets or sets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled. |
Methods
Name | Description |
---|---|
add_figure(figure) | Adds a new figure. |
add_figures(figures) | Adds new figures. |
add_path(adding_path) | Appends the specified GraphicsPath to this path. |
add_path(adding_path, connect) | Appends the specified GraphicsPath to this path. |
deep_clone() | Performs a deep clone of this graphics path. |
flatten() | Converts each curve in this path into a sequence of connected line segments. |
flatten(matrix) | Applies the specified transform and then converts each curve in this GraphicsPath into a sequence of connected line segments. |
flatten(matrix, flatness) | Converts each curve in this GraphicsPath into a sequence of connected line segments. |
get_bounds(matrix) | Gets the object’s bounds. |
get_bounds(matrix, pen) | Gets the object’s bounds. |
is_outline_visible(point, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible(point, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible(pt, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible(pt, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible(x, y, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible(x, y, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible(x, y, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible(x, y, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible_point(point, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible_point_f(point, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible_point_f_graphics(pt, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible_point_graphics(pt, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible_xy(x, y, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible_xy_graphics(x, y, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_outline_visible_xyf(x, y, pen) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen. |
is_outline_visible_xyf_graphics(x, y, pen, graphics) | Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics. |
is_visible(point) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(point) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(pt, graphics) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(pt, graphics) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(x, y) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(x, y) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible(x, y, graphics) | Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics. |
is_visible(x, y, graphics) | Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics. |
is_visible_point(point) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_point_f(point) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_point_f_graphics(pt, graphics) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_point_graphics(pt, graphics) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_xy(x, y) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_xy_graphics(x, y, graphics) | Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics. |
is_visible_xyf(x, y) | Indicates whether the specified point is contained within this GraphicsPath. |
is_visible_xyf_graphics(x, y, graphics) | Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics. |
remove_figure(figure) | Removes a figure. |
remove_figures(figures) | Removes figures. |
reset() | Empties the graphics path and sets the FillMode to FillMode.ALTERNATE. |
reverse() | Reverses the order of figures, shapes, and points in each shape of this GraphicsPath. |
transform(transform) | Applies the specified transformation to the shape. |
warp(dest_points, src_rect) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath. |
warp(dest_points, src_rect, matrix) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath. |
warp(dest_points, src_rect, matrix, warp_mode) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath. |
warp(dest_points, src_rect, matrix, warp_mode, flatness) | Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath. |
widen(pen) | Adds an additional outline to the path. |
widen(pen, matrix) | Adds an additional outline to the GraphicsPath. |
widen(pen, matrix, flatness) | Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen. |
Constructor: GraphicsPath()
GraphicsPath()
Initializes a new instance of the GraphicsPath class.
See also:
Example # 1: This examples make use of GraphicsPath and Graphics classes to create and man…
Constructor: GraphicsPath(figures)
GraphicsPath(figures)
Initializes a new instance of the GraphicsPath class.
Parameters:
Parameter | Type | Description |
---|---|---|
figures | Figure[] | The figures to initialize from. |
Constructor: GraphicsPath(figures, fill_mode)
GraphicsPath(figures, fill_mode)
Initializes a new instance of the GraphicsPath class.
Parameters:
Parameter | Type | Description |
---|---|---|
figures | Figure[] | The figures to initialize from. |
fill_mode | FillMode | The fill mode. |
Constructor: GraphicsPath(fill_mode)
GraphicsPath(fill_mode)
Initializes a new instance of the GraphicsPath class.
Parameters:
Parameter | Type | Description |
---|---|---|
fill_mode | FillMode | The fill mode. |
Method: add_figure(figure)
add_figure(figure)
Adds a new figure.
Parameters:
Parameter | Type | Description |
---|---|---|
figure | Figure | The figure to add. |
See also:
Example # 1: This examples make use of GraphicsPath and Graphics classes to create and man…
Method: add_figures(figures)
add_figures(figures)
Adds new figures.
Parameters:
Parameter | Type | Description |
---|---|---|
figures | Figure[] | The figures to add. |
See also:
Example # 1: This example creates a new Image and draws a variety of shapes using figures …
Method: add_path(adding_path)
add_path(adding_path)
Appends the specified GraphicsPath to this path.
Parameters:
Parameter | Type | Description |
---|---|---|
adding_path | GraphicsPath | The GraphicsPath to add. |
Method: add_path(adding_path, connect)
add_path(adding_path, connect)
Appends the specified GraphicsPath to this path.
Parameters:
Parameter | Type | Description |
---|---|---|
adding_path | GraphicsPath | The GraphicsPath to add. |
connect | bool | 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. |
Method: deep_clone()
deep_clone()
Performs a deep clone of this graphics path.
Returns
Type | Description |
---|---|
GraphicsPath | A deep clone of the graphics path. |
Method: flatten(matrix)
flatten(matrix)
Applies the specified transform and then converts each curve in this GraphicsPath into a sequence of connected line segments.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | A Matrix by which to transform this GraphicsPath before flattening. |
Method: flatten(matrix, flatness)
flatten(matrix, flatness)
Converts each curve in this GraphicsPath into a sequence of connected line segments.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | A Matrix by which to transform this GraphicsPath before flattening. |
flatness | float | 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. |
Method: get_bounds(matrix)
get_bounds(matrix)
Gets the object’s bounds.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The matrix to apply before bounds will be calculated. |
Returns
Type | Description |
---|---|
RectangleF | The estimated object’s bounds. |
Method: get_bounds(matrix, pen)
get_bounds(matrix, pen)
Gets the object’s bounds.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The matrix to apply before bounds will be calculated. |
pen | Pen | The pen to use for object. This can influence the object’s bounds size. |
Returns
Type | Description |
---|---|
RectangleF | The estimated object’s bounds. |
Method: is_outline_visible(point, pen)
is_outline_visible(point, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
point | PointF | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(point, pen)
is_outline_visible(point, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
point | Point | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(pt, pen, graphics)
is_outline_visible(pt, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | PointF | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(pt, pen, graphics)
is_outline_visible(pt, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(x, y, pen)
is_outline_visible(x, y, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(x, y, pen)
is_outline_visible(x, y, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(x, y, pen, graphics)
is_outline_visible(x, y, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible(x, y, pen, graphics)
is_outline_visible(x, y, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_point(point, pen)
is_outline_visible_point(point, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
point | Point | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_point_f(point, pen)
is_outline_visible_point_f(point, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
point | PointF | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_point_f_graphics(pt, pen, graphics)
is_outline_visible_point_f_graphics(pt, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | PointF | A PointF that specifies the location to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_point_graphics(pt, pen, graphics)
is_outline_visible_point_graphics(pt, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | A Point that specifies the location to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_xy(x, y, pen)
is_outline_visible_xy(x, y, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_xy_graphics(x, y, pen, graphics)
is_outline_visible_xy_graphics(x, y, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_xyf(x, y, pen)
is_outline_visible_xyf(x, y, pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within the outline of this GraphicsPath when drawn with the specified Pen; otherwise, false. |
Method: is_outline_visible_xyf_graphics(x, y, pen, graphics)
is_outline_visible_xyf_graphics(x, y, pen, graphics)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
pen | Pen | The Pen to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within (under) the outline of this GraphicsPath as drawn with the specified Pen; otherwise, false. |
Method: is_visible(point)
is_visible(point)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
point | PointF | A PointF that represents the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible(point)
is_visible(point)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
point | Point | A PointF that represents the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible(pt, graphics)
is_visible(pt, graphics)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | PointF | A PointF that represents the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this; otherwise, false. |
Method: is_visible(pt, graphics)
is_visible(pt, graphics)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | A PointF that represents the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this; otherwise, false. |
Method: is_visible(x, y)
is_visible(x, y)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible(x, y)
is_visible(x, y)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible(x, y, graphics)
is_visible(x, y, graphics)
Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible(x, y, graphics)
is_visible(x, y, graphics)
Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_point(point)
is_visible_point(point)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
point | Point | A PointF that represents the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_point_f(point)
is_visible_point_f(point)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
point | PointF | A PointF that represents the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_point_f_graphics(pt, graphics)
is_visible_point_f_graphics(pt, graphics)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | PointF | A PointF that represents the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this; otherwise, false. |
Method: is_visible_point_graphics(pt, graphics)
is_visible_point_graphics(pt, graphics)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | A Point that represents the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_xy(x, y)
is_visible_xy(x, y)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_xy_graphics(x, y, graphics)
is_visible_xy_graphics(x, y, graphics)
Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | int | The x-coordinate of the point to test. |
y | int | The y-coordinate of the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_xyf(x, y)
is_visible_xyf(x, y)
Indicates whether the specified point is contained within this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: is_visible_xyf_graphics(x, y, graphics)
is_visible_xyf_graphics(x, y, graphics)
Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
x | float | The x-coordinate of the point to test. |
y | float | The y-coordinate of the point to test. |
graphics | Graphics | The Graphics for which to test visibility. |
Returns
Type | Description |
---|---|
bool | This method returns true if the specified point is contained within this GraphicsPath; otherwise, false. |
Method: remove_figure(figure)
remove_figure(figure)
Removes a figure.
Parameters:
Parameter | Type | Description |
---|---|---|
figure | Figure | The figure to remove. |
Method: remove_figures(figures)
remove_figures(figures)
Removes figures.
Parameters:
Parameter | Type | Description |
---|---|---|
figures | Figure[] | The figures to remove. |
Method: transform(transform)
transform(transform)
Applies the specified transformation to the shape.
Parameters:
Parameter | Type | Description |
---|---|---|
transform | Matrix | The transformation to apply. |
Method: warp(dest_points, src_rect)
warp(dest_points, src_rect)
Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
dest_points | PointF[] | 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. |
src_rect | RectangleF | A RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints. |
Method: warp(dest_points, src_rect, matrix)
warp(dest_points, src_rect, matrix)
Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
dest_points | PointF[] | 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. |
src_rect | RectangleF | A RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints. |
matrix | Matrix | A Matrix that specifies a geometric transform to apply to the path. |
Method: warp(dest_points, src_rect, matrix, warp_mode)
warp(dest_points, src_rect, matrix, warp_mode)
Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
dest_points | PointF[] | 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. |
src_rect | RectangleF | A RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints. |
matrix | Matrix | A Matrix that specifies a geometric transform to apply to the path. |
warp_mode | WarpMode | A WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode. |
Method: warp(dest_points, src_rect, matrix, warp_mode, flatness)
warp(dest_points, src_rect, matrix, warp_mode, flatness)
Applies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
dest_points | PointF[] | 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. |
src_rect | RectangleF | A RectangleF that represents the rectangle that is transformed to the parallelogram defined by destPoints. |
matrix | Matrix | A Matrix that specifies a geometric transform to apply to the path. |
warp_mode | WarpMode | A WarpMode enumeration that specifies whether this warp operation uses perspective or bilinear mode. |
flatness | float | A value from 0 through 1 that specifies how flat the resulting path is. For more information, see the GraphicsPath.flatten() methods. |
Method: widen(pen)
widen(pen)
Adds an additional outline to the path.
Parameters:
Parameter | Type | Description |
---|---|---|
pen | Pen | A Pen that specifies the width between the original outline of the path and the new outline this method creates. |
Method: widen(pen, matrix)
widen(pen, matrix)
Adds an additional outline to the GraphicsPath.
Parameters:
Parameter | Type | Description |
---|---|---|
pen | Pen | A Pen that specifies the width between the original outline of the path and the new outline this method creates. |
matrix | Matrix | A Matrix that specifies a transform to apply to the path before widening. |
Method: widen(pen, matrix, flatness)
widen(pen, matrix, flatness)
Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.
Parameters:
Parameter | Type | Description |
---|---|---|
pen | Pen | A Pen that specifies the width between the original outline of the path and the new outline this method creates. |
matrix | Matrix | A Matrix that specifies a transform to apply to the path before widening. |
flatness | float | A value that specifies the flatness for curves. |
Examples
This examples make use of GraphicsPath and Graphics classes to create and manipulate figures on an Image surface. Example creates a new Image (of type Tiff), clears the surface and draws paths with the help of GraphicsPath class. At the end draw_path
method exposed by Graphics class is called to render the paths on surface.
from aspose.imaging import Image, Graphics, Color, GraphicsPath, Figure, RectangleF, PointF, SizeF
from aspose.imaging import Pen
from aspose.imaging.sources import StreamSource
from aspose.imaging.imageoptions import TiffOptions
from aspose.imaging.fileformats.tiff.enums import TiffExpectedFormat
from aspose.imaging.shapes import RectangleShape, EllipseShape, PieShape
# Create an instance of a file stream
with open(r"C:\temp\output.tiff", "w+b") as stream:
# Create an instance of TiffOptions and set its various properties
tiffOptions = TiffOptions(TiffExpectedFormat.DEFAULT)
# Set the source for the instance of ImageOptions
tiffOptions.source = StreamSource(stream)
# Create an instance of Image
with Image.create(tiffOptions, 500, 500) as image:
# Create and initialize an instance of Graphics class
graphics = Graphics(image)
# Clear Graphics surface
graphics.clear(Color.wheat);
# Create an instance of GraphicsPath class
graphics_path = GraphicsPath()
# Create an instance of Figure class
figure = Figure()
# Add Shapes to Figure object
figure.add_shape(RectangleShape(RectangleF(10.0, 10.0, 300.0, 300.0)))
figure.add_shape(EllipseShape(RectangleF(50.0, 50.0, 300.0, 300.0)))
figure.add_shape(PieShape(RectangleF(PointF(250.0, 250.0), SizeF(200.0, 200.0)), 0.0, 45.0))
# Add Figure object to GraphicsPath
graphics_path.add_figure(figure)
# Draw path with Pen object of color Black
graphics.draw_path(Pen(Color.black, 2.0), graphics_path)
# save all changes.
image.save()
This example creates a new Image and draws a variety of shapes using figures and GraphicsPath
on the Image
surface
from aspose.imaging import Image, Graphics, Color, GraphicsPath, Figure, RectangleF, Rectangle, Size
from aspose.imaging import Point, PointF, Pen
from aspose.imaging.imageoptions import BmpOptions
from aspose.imaging.sources import FileCreateSource
from aspose.imaging.shapes import EllipseShape, PieShape, ArcShape, PolygonShape, RectangleShape
from os.path import join as path_join
#Creates an instance of BmpOptions and set its various properties
with BmpOptions() as bmpOptions:
bmpOptions.bits_per_pixel = 24
#Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
#Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.source = FileCreateSource(r"c:\temp\output.bmp", False)
#Create an instance of Image
with Image.create(bmpOptions, 500, 500) as image:
# Create and initialize an instance of Graphics class
graphics = Graphics(image)
# Clear Graphics surface
graphics.clear(Color.wheat)
# Create an instance of GraphicsPath class
graphicspath = GraphicsPath()
#Create an instance of Figure class
figure1 = Figure()
# Add Shape to Figure object
figure1.add_shape(EllipseShape(RectangleF(50, 50, 300, 300)))
figure1.add_shape(PieShape(Rectangle(Point(110, 110), Size(200, 200)), 0, 90))
# Create an instance of Figure class
figure2 = Figure()
# Add Shape to Figure object
figure2.add_shape(ArcShape(RectangleF(10, 10, 300, 300), 0, 45))
figure2.add_shape(
PolygonShape([PointF(150, 10), PointF(150, 200), PointF(250, 300), PointF(350, 400)], True))
figure2.add_shape(RectangleShape(RectangleF(Point(250, 250), Size(200, 200))))
# Add Figure object to GraphicsPath
graphicspath.add_figures([figure1, figure2])
# Draw path with Pen object of color Black
graphics.draw_path(Pen(Color.black, 2.0), graphicspath)
# save all changes.
image.save()