public class Path extends Object
A path can be used by Canvas#drawPath(Path, Paint) in Canvas, and can also be used for clipping.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
Path.AddPathMode |
Enumerates the modes of adding a path to another path.
|
static class |
Path.ArcSize |
Enumerates the modes of adding an arc.
|
static class |
Path.Direction |
Enumerates drawing directions of a
Path object. |
static class |
Path.FillType |
Enumerates filling types of a
Path object. |
| 构造器 | 说明 |
|---|---|
Path() |
Default constructor used to create a
Path instance. |
Path(Path path) |
A constructor used to create a
Path instance with a specified path. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addArc(RectFloat rect,
float startAngle,
float sweepAngle) |
Adds an arc to this
Path with a specified start angle and sweep angle. |
void |
addCircle(float xCoor,
float yCoor,
float radius,
Path.Direction direction) |
Adds a circle to this
Path. |
void |
addCircle(Point centerPoint,
float radius,
Path.Direction direction) |
Adds a circle with a specified radius to this
Path object. |
void |
addOval(RectFloat rect,
Path.Direction direction) |
Adds an oval to this
Path object. |
void |
addOval(RectFloat rectFloat,
Path.Direction direction,
int start) |
Adds an oval to this
Path. |
void |
addPath(Path path) |
Adds a specified path to this
Path object without any connection action. |
void |
addPath(Path src,
float dx,
float dy,
Path.AddPathMode mode) |
Adds a specified path to this
Path with an offset. |
void |
addPath(Path src,
Path.AddPathMode mode) |
Adds a specified path to this
Path. |
void |
addPath(Path src,
Matrix matrix,
Path.AddPathMode mode) |
Adds a specified path to this
Path, transformed by matrix. |
void |
addRect(float left,
float top,
float right,
float bottom,
Path.Direction direction) |
Adds a rectangle to this
Path. |
void |
addRect(RectFloat rect,
Path.Direction direction) |
Adds a rounded rectangle with a specified corner radius to this
Path object. |
void |
addRect(RectFloat rectFloat,
Path.Direction direction,
int start) |
Adds a rectangle to this
Path starting with a specified corner. |
void |
addRoundRect(RectFloat rect,
float[] radius,
Path.Direction direction) |
Add a round rect with specified corner radius to the
Path. |
void |
addRoundRect(RectFloat rectFloat,
float xRadius,
float yRadius,
Path.Direction direction) |
Adds a rounded rectangle to this
Path. |
void |
arcTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float radius) |
Adds an arc to this
Path. |
void |
arcTo(Point radius,
float xAxisRotate,
Path.ArcSize largeArc,
Path.Direction sweep,
Point xy) |
Adds an arc implemented by one or more conics.
|
void |
arcTo(Point point0,
Point point1,
float radius) |
Adds an arc.
|
void |
arcTo(RectFloat rect,
float startAngle,
float sweepAngle) |
Adds an arc.
|
void |
arcTo(RectFloat rect,
float startAngle,
float sweepAngle,
boolean forceMoveTo) |
Adds an arc.
|
void |
close() |
Connects the start point and end point of the path to form a closed path.
|
void |
computeBounds(RectFloat bounds) |
Computes the bounds of this
Path object, that is, the minimum enclosing rectangle of this path. |
RectFloat |
computeTightBounds() |
Computes the tight bounds of this
Path. |
void |
conicTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float weight) |
Adds a conic curve based on the absolute position.
|
void |
conicTo(Point point0,
Point point1,
float weight) |
Adds a conic curve.
|
boolean |
conservativelyContainsRect(RectFloat rectFloat) |
Checks whether this
Path contains a specified rectangle area. |
boolean |
contains(float xCoor,
float yCoor) |
Checks whether a specified point is contained in the area enclosed by this
Path. |
int |
countPoints() |
Obtains the number of points in this
Path. |
int |
countVerbs() |
Obtains the length of the verb array contained in this
Path. |
void |
cubicTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
Adds a cubic bezier curve.
|
void |
cubicTo(Point point0,
Point point1,
Point point2) |
Adds a cubic Bezier curve.
|
Path.FillType |
getFillType() |
Obtains the filling type of this
Path object. |
boolean |
getLastPoint(Point point) |
Obtains the last point in the point array of this
Path. |
void |
incReserve(int extraPointCount) |
Adds a specified length to the verb and point arrays of this
Path. |
boolean |
interpolate(Path ending,
float weight,
Path out) |
Performs interpolation between this
Path and a path with the same length of point array. |
boolean |
isConvex() |
Checks whether this path is convex.
|
boolean |
isEmpty() |
Checks whether this
Path object is empty. |
boolean |
isFinite() |
Checks whether the values in the point array in this
Path are finite. |
boolean |
isInterpolatable(Path compare) |
Checks whether the interpolation operation is allowed.
|
boolean |
isInverseFillType() |
Checks whether the filling area is outside this
Path. |
boolean |
isLastContourClosed() |
Checks whether the last contour added to this
Path is closed. |
boolean |
isOval(RectFloat bounds) |
Checks whether this
Path is identified as an oval or circle. |
boolean |
isValid() |
Checks whether this
Path is valid. |
boolean |
isVolatile() |
Checks whether this
Path is volatile. |
void |
lineTo(float xCoor,
float yCoor) |
Adds a line to the
Path object. |
void |
lineTo(Point point) |
Adds a line from the last point of this
Path to point. |
void |
moveTo(float xCoor,
float yCoor) |
Sets the start point of this path.
|
void |
moveTo(Point point) |
Adds a point to this
Path as the start point of the next contour. |
void |
offset(float offsetX,
float offsetY) |
Offsets this
Path by a specified coordinate. |
void |
offset(float offsetX,
float offsetY,
Path dst) |
Offsets this
Path by a specified distance. |
void |
quadTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1) |
Adds a smooth quadratic bezier curve from the last point of this
Path to (xCoor1, yCoor1) based on the
absolute position. |
void |
quadTo(Point point0,
Point point1) |
Adds a smooth quadratic Bezier curve.
|
void |
rConicTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float weight) |
Adds a conic curve based on the relative position.
|
void |
reset() |
Clears the
Path object. |
void |
reverseAddPath(Path src) |
Adds a specified path to this
Path in a reverse direction. |
void |
rewind() |
Sets this
Path object to its initial state. |
void |
rLineTo(float xCoor,
float yCoor) |
Adds a straight line segment to this
Path object. |
void |
rMoveTo(float dx,
float dy) |
Adds a point to this
Path as the start point of the next contour, the coordinates of which are relative
to the last point of this Path. |
void |
rQuadTo(float dx1,
float dy1,
float dx2,
float dy2) |
Adds a smooth quadratic bezier curve based on the relative position.
|
void |
set(Path path) |
Replaces this
Path object with a specified path. |
void |
setFillType(Path.FillType fillType) |
Sets the filling type for this
Path object. |
void |
setIsVolatile(boolean isVolatile) |
Sets whether this
Path is volatile. |
void |
setLastPoint(float dx,
float dy) |
Sets the last point for this
Path based on specified coordinates. |
void |
setLastPoint(Point point) |
Sets the last point for this
Path. |
void |
shrinkToFit() |
Releases the memory unused in the verb and point arrays of this
Path. |
void |
swap(Path other) |
Swaps this
Path for a specified path. |
void |
toggleInverseFillType() |
Replaces the fill type with its inverse one for this
Path. |
void |
transform(Matrix matrix) |
Transforms this
Path by matrix. |
void |
transformToNewPath(Matrix matrix,
Path newPath) |
Transforms this
Path to a new one by matrix. |
void |
updateBoundsCache() |
Updates the bounds cache of this
Path. |
public Path()
Path instance.public Path(Path path)
Path instance with a specified path.path - Indicates the target path used to create a new path.public void moveTo(float xCoor,
float yCoor)
After a path is created, you can call this method to specify its start point. Otherwise, the start point is at the origin (0, 0).
xCoor - Indicates the X-axis coordinate of the start point.yCoor - Indicates the Y-axis coordinate of the start point.public void lineTo(float xCoor,
float yCoor)
Path object.
The line starts from the end point of the path, and ends at the point specified by xCoor
and yCoor.
xCoor - Indicates the X-axis coordinate of the end point of the line to add.yCoor - Indicates the Y-axis coordinate of the end point of the line to add.public void quadTo(Point point0, Point point1)
The new quadratic Bezier curve starts from the current last point of this path, goes towards the control
point point0, and ends at point1.
point0 - Indicates the coordinates of the control point of the quadratic Bezier curve to add.point1 - Indicates the coordinates of the end point of the quadratic Bezier curve to add.public void cubicTo(Point point0, Point point1, Point point2)
The new cubic Bezier curve starts from the current last point of this path and ends at point2 with
control points point0 and point1 used to provide directional information.
point0 - Indicates the coordinates of the first control point of the cubic Bezier curve to add.point1 - Indicates the coordinates of the second control point of the cubic Bezier curve to add.point2 - Indicates the coordinates of the end point of the cubic Bezier curve to add.public void cubicTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
x1 - Indicates the x-coordinate of the first control point on the curve to add.y1 - Indicates the y-coordinate of the first control point on the curve to add.x2 - Indicates the x-coordinate of the second control point on the curve to add.y2 - Indicates the y-coordinate of the second control point on the curve to add.x3 - Indicates the x-coordinate of the third control point on the curve to add.y3 - Indicates the y-coordinate of the third control point on the curve to add.public void arcTo(Point point0, Point point1, float radius)
Assuming that the current last point of this path is a, the arc to add is a part of the circle whose radius
is radius and is tangential to line (point0, a) and line (point0, point1), and
the start and end points of the arc are the two tangential points. If point a is not the start point of the arc,
a line segment from point a to the arc's start point will first be added to this path before the arc is added.
point0 - Indicates the coordinates of the arc's first control point.point1 - Indicates the coordinates of the arc's control point controlling the direction to the end point.radius - Indicates the arc's radius.public void arcTo(RectFloat rect, float startAngle, float sweepAngle)
If the end point of the path is not the start point of the arc, a line segment from the end point of the path to the start point of the arc will be added.
rect - Indicates the enclosing rectangle of the arc.startAngle - Indicates the start angle of the arc.sweepAngle - Indicates the sweep angle of the arc, that is, the central angle of the arc center.public void arcTo(RectFloat rect, float startAngle, float sweepAngle, boolean forceMoveTo)
rect - Indicates the enclosing rectangle of the arc.startAngle - Indicates the start angle of the arc.sweepAngle - Indicates the sweep angle of the arc, that is, the central angle of the arc center.forceMoveTo - Specifies whether to forcibly move the end point of the path to the start point of the arc.
If the value is false and the end point of the path is not the start point of the arc, a line segment
from the end point of the path to the start point of the arc is added. If the value is true, the
specified arc is added to the path.public void conicTo(Point point0, Point point1, float weight)
If weight is greater than 1, a hyperbola will be added. If weight is 1, a parabola
will be added, and this method has the same effect as Path#quadTo(Point, Point). If weight is
less than 1, a part of an ellipse will be added.
point0 - Indicates the coordinates of the control point of the conic curve to add.point1 - Indicates the coordinates of the end point of the conic curve to add.weight - Indicates the weight of the conic curve.public void close()
public void reset()
Path object.
This method does not retain the internal data structure of this path, but its FillType will not
change.
public void addPath(Path path)
Path object without any connection action.
For example, if the current path in this Path object has a line segment from p0 to p1, and the path
to add has a line segment from p2 to p3, then there will be two line segments (p0, p1) and (p2, p3) in this
Path object after this method is called.
path - Indicates the path to add.public void addArc(RectFloat rect, float startAngle, float sweepAngle)
Path with a specified start angle and sweep angle.
The difference between this method and Path#arcTo is that arcTo will connect the current last
point of this Path to the start point of the arc if the two points are different.
rect - Indicates the enclosing rectangle of the arc to add.startAngle - Indicates the start angle of the arc to add.sweepAngle - Indicates the sweep angle of the arc to add.public void addCircle(Point centerPoint, float radius, Path.Direction direction)
Path object.centerPoint - Indicates the coordinate of the circle's center point.radius - Indicates the circle's radius.direction - Indicates the circle's drawing direction. For details about available values,
see Path.Direction.public void addOval(RectFloat rect, Path.Direction direction)
Path object.rect - Indicates the enclosing rectangle of the oval to add.direction - Indicates the oval's drawing direction. For details about available values,
see Path.Direction.public boolean isEmpty()
Path object is empty.
A Path object is considered empty if no data structure is added to it.
true if this Path is empty; returns false otherwise.public void computeBounds(RectFloat bounds)
Path object, that is, the minimum enclosing rectangle of this path.
If this path is empty or there is only one point in the path, the bound is (0, 0, 0, 0).
bounds - Indicates the object for saving the bounds returned by this path. The initial value
is (0, 0, 0, 0).public void addRect(RectFloat rect, Path.Direction direction)
Path object.rect - Indicates the position and size of the rounded rectangle to add.direction - Indicates the rectangle's drawing direction. For details about available values,
see Path.Direction.public void addRoundRect(RectFloat rect, float[] radius, Path.Direction direction)
Path.rect - Indicates the position and size of the rounded rectangle to add.radius - Indicates the corner radius of the rounded rectangle, the radius array length is 8.direction - Indicates the rounded rectangle's drawing direction. For details about available values,
see Path.Direction.public void rLineTo(float xCoor,
float yCoor)
Path object.
The difference between this method and Path#lineTo is that lineTo directly connects the last
point (px, py) and the point (xCoor, yCoor) of the path, but rLinetTo adds a straight
line segment from the point (px, py) to (xCoor+px, yCoor+py).
xCoor - Indicates the X-axis coordinate of the end point of the line to add, relative to (px, py).yCoor - Indicates the Y-axis coordinate of the end point of the line to add, relative to (px, py).public void offset(float offsetX,
float offsetY)
Path by a specified coordinate.offsetX - Indicates the offset added to the X-axis, in pixels.offsetY - Indicates the offset added to the Y-axis, in pixels.public void rewind()
Path object to its initial state.
This method is different from Path#reset. The reset method clears only the original data
structure of the path and does not change the filling type, and this method resets only the filling type of the
path to the default value WINDING_ORDER and keeps the original data structure. The rewinding speed
varies with data structures.
public void transform(Matrix matrix)
Path by matrix.matrix - Indicates the matrix used to transform this path.public void transformToNewPath(Matrix matrix, Path newPath)
Path to a new one by matrix.matrix - Indicates the matrix used to transform this Path.newPath - Indicates the new path. If this parameter is null, then this Path is modified.public void set(Path path)
Path object with a specified path.path - Indicates the target Path object used to replace this path.public void setFillType(Path.FillType fillType)
Path object.
The filling type affects the display effect of a path.
fillType - Indicates the new filling type to be set. The default value is WINDING_ORDER. For
details about available values, see FillType.public Path.FillType getFillType()
Path object.public void setLastPoint(float dx,
float dy)
Path based on specified coordinates.dx - Indicates the x-coordinate of the last point to set.dy - Indicates the y-coordinate of the last point to set.public boolean isConvex()
true if this path is convex; returns false otherwise.public boolean isInterpolatable(Path compare)
Interpolation can be performed only when the parameters of this Path are equal to those of
compare. The parameters include the verb array and weight (if a cone is added) of paths.
compare - Indicates the specified path used for comparison.true if the parameters of this Path are equal to those of the specified path;
returns false otherwise.public boolean interpolate(Path ending, float weight, Path out)
Path and a path with the same length of point array.
Generally, isInterpolatable(ohos.agp.render.Path) is called first to check whether the interpolation operation is allowed.
ending - Indicates the path whose length of point array is compared with that of this Path.weight - Indicates the weight of the point array of this Path.out - Used to save the interpolation result.true if the point array length of this Path is the same as that of
ending; returns false otherwise (out remains unchanged).public boolean isInverseFillType()
Path.true if the filling area is outside this Path, that is, the value of
FillType for this Path is INVERSE_WINDING or INVERSE_EVEN_ODD; returns
false otherwise.public void toggleInverseFillType()
Path.public boolean isOval(RectFloat bounds)
Path is identified as an oval or circle.bounds - Used to save the bounds of the minimum rectangle holding the oval or circle.true if this Path is identified as an oval or circle; returns false
otherwise (bounds remains unchanged).public boolean isLastContourClosed()
Path is closed.
A path may contain multiple contours. If the last operation is close(), the last contour added to this
Path is considered to be closed.
true if the last contour added to this Path is closed, that is, the last value of
the verb array is CLOSE_VERB; returns false otherwise.public boolean isFinite()
Path are finite.true if all values in the point array are finite (between positive and negative
3.402823466e+38f); returns false otherwise.public boolean isVolatile()
Path is volatile.
If this Path is modified after being drawn, the path is considered to be volatile. By default, a path
is set nonvolatile for speeding up repeated drawings.
true if this Path is modified after being drawn; returns false otherwise.public void setIsVolatile(boolean isVolatile)
Path is volatile.isVolatile - Specifies whether this Path is volatile. The value true indicates this
Path is volatile, and false indicates the opposite case.public int countPoints()
Path.public void swap(Path other)
Path for a specified path.other - Indicates the specified path.public RectFloat computeTightBounds()
Path.public boolean conservativelyContainsRect(RectFloat rectFloat)
Path contains a specified rectangle area.
The item to be checked may be a line, point, or rectangle.
rectFloat - Indicates the specified rectangle area.true if this Path contains the specified rectangle area; returns false
otherwise.public void incReserve(int extraPointCount)
Path.
This method helps improve performance and use less memory by reducing the number and size of allocations when creating a path.
extraPointCount - Indicates the specified length to add.public void shrinkToFit()
Path.
This method allows this Path to reduce its heap overhead.
public void moveTo(Point point)
Path as the start point of the next contour.point - Indicates the point to add.public void rMoveTo(float dx,
float dy)
Path as the start point of the next contour, the coordinates of which are relative
to the last point of this Path.dx - Indicates the x-axis offset relative to the last point of this Path.dy - Indicates the y-axis offset relative to the last point of this Path.public void lineTo(Point point)
Path to point.point - Indicates the last point of the line to add.public void quadTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1)
Path to (xCoor1, yCoor1) based on the
absolute position.xCoor0 - Indicates the x-coordinate of the quadratic bezier curve's control point.yCoor0 - Indicates the y-coordinate of the quadratic bezier curve's control point.xCoor1 - Indicates the x-coordinate of the quadratic bezier curve's last point.yCoor1 - Indicates the y-coordinate of the quadratic bezier curve's last point.public void rQuadTo(float dx1,
float dy1,
float dx2,
float dy2)
dx1 - Indicates the x-axis offset of the quadratic bezier curve's control point.dy1 - Indicates the y-axis offset of the quadratic bezier curve's control point.dx2 - Indicates the x-axis offset of the quadratic bezier curve's last point.dy2 - Indicates the y-axis offset of the quadratic bezier curve's last point.public void conicTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float weight)
If weight is greater than 1, the conic is a hyperbola. If weight is 1, the
conic is a parabola and this method is equivalent to quadTo(ohos.agp.utils.Point, ohos.agp.utils.Point). If weight is less than 1,
the conic is a part of an oval.
xCoor0 - Indicates the x-coordinate of the conic curve's control point.yCoor0 - Indicates the y-coordinate of the conic curve's control point.xCoor1 - Indicates the x-coordinate of the conic curve's last point.yCoor1 - Indicates the y-coordinate of the conic curve's last point.weight - Indicates the weight of the conic curve.public void rConicTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float weight)
xCoor0 - Indicates the x-coordinate of the conic curve's control point.yCoor0 - Indicates the y-coordinate of the conic curve's control point.xCoor1 - Indicates the x-axis offset of the conic curve's last point.yCoor1 - Indicates the y-axis offset of the conic curve's last point.weight - Indicates the weight of the conic curve.public void arcTo(float xCoor0,
float yCoor0,
float xCoor1,
float yCoor1,
float radius)
Path.
Assume that the last point of this Path is a. The arc to add is a part of an inscribed circle
whose radius is radius and two tangent lines are determined by ((xCoor0, yCoor0), a) and ((xCoor0,
yCoor0), xCoor1, yCoor), respectively. The tangent points are the arc's start and last point, respectively. If
the start point of the arc to add is not the current path's last point a, then a line from a to
the start point of the arc should be added first.
xCoor0 - Indicates the x-coordinate of the arc's control point.yCoor0 - Indicates the y-coordinate of the arc's control point.xCoor1 - Indicates the x-coordinate of the point controlling the arc's last point.yCoor1 - Indicates the y-coordinate of the point controlling the arc's last point.radius - Indicates the arc's radius.public void arcTo(Point radius, float xAxisRotate, Path.ArcSize largeArc, Path.Direction sweep, Point xy)
You can rotate an oval of the specified radius by xAxisRotate degrees, and then scale it
around xy (coordinates of the arc's last point), and finally add an arc from the last point of this
Path to xy.
radius - Indicates the x-axis and y-axis radiuses of the oval.xAxisRotate - Indicates the rotation angle of the oval of a specified size.largeArc - Indicates the specified arc of the oval.sweep - Indicates the sweep mode of the arc to add.xy - Indicates the coordinates of the arc's last point.public void addRect(RectFloat rectFloat, Path.Direction direction, int start)
Path starting with a specified corner.
In actual implementation, the coordinates of the rectangle's four corners are added to the point array of this
Path. You can specify the corner to be first drawn based on start.
rectFloat - Indicates the rectangle to add.direction - Indicates the rectangle's drawing direction, as enumerated in Direction.start - Indicates the rectangle's corner to be first drawn.public void addRect(float left,
float top,
float right,
float bottom,
Path.Direction direction)
Path.left - Indicates the x-coordinate of the rectangle's upper left corner.top - Indicates the y-coordinate of the rectangle's upper left corner.right - Indicates the x-coordinate of the rectangle's lower right corner.bottom - Indicates the x-coordinate of the rectangle's lower right corner.direction - Indicates the rectangle's drawing direction, as enumerated in Direction.public void addOval(RectFloat rectFloat, Path.Direction direction, int start)
Path.rectFloat - Indicates the external rectangle holding the oval.direction - Indicates the oval's drawing direction, as enumerated in Direction.start - Indicates the index of the oval's start point. The default value is rectFloat.right,
(rectFloat.bottom + rectFloat.top) / 2 representing the oval's right boundary point.public void addCircle(float xCoor,
float yCoor,
float radius,
Path.Direction direction)
Path.xCoor - Indicates the x-coordinate of the circle's center point.yCoor - Indicates the y-coordinate of the circle's center point.radius - Indicates the circle's radius.direction - Indicates the rectangle's drawing direction, as enumerated in Direction.public void addRoundRect(RectFloat rectFloat, float xRadius, float yRadius, Path.Direction direction)
Path.rectFloat - Indicates the position and size of the rounded rectangle.xRadius - Indicates the radius of the four rounded corners in the x-axis direction.yRadius - Indicates the radius of the four rounded corners in the y-axis direction.direction - Indicates the rectangle's drawing direction, as enumerated in Direction.public void addPath(Path src, Path.AddPathMode mode)
Path.
The mode of adding a path can be AddPathMode#APPEND_ADD_PATH_MODE or
AddPathMode#EXTEND_ADD_PATH_MODE. The former one indicates no connection between any points, and the
latter one indicates that a straight line is added between the last point of this Path and the start
point of src.
src - Indicates the specified path to add.mode - Indicates the mode of adding a path.public void addPath(Path src, float dx, float dy, Path.AddPathMode mode)
Path with an offset.
The mode of adding a path can be AddPathMode#APPEND_ADD_PATH_MODE or
AddPathMode#EXTEND_ADD_PATH_MODE. The former one indicates no connection between any points, and the
latter one indicates that a straight line is added between the last point of this Path and the start
point of src.
src - Indicates the specified path to add.dx - Indicates the horizontal offset of the specified path.dy - Indicates the vertical offset of the specified path.mode - Indicates the mode of adding a path.public void addPath(Path src, Matrix matrix, Path.AddPathMode mode)
Path, transformed by matrix.
The mode of adding a path can be AddPathMode#APPEND_ADD_PATH_MODE or
AddPathMode#EXTEND_ADD_PATH_MODE. The former one indicates no connection between any points, and the
latter one indicates that a straight line is added between the last point of this Path and the start
point of src.
src - Indicates the specified path to add.matrix - Indicates the matrix used to transform the specified path.mode - Indicates the mode of adding a path.public void reverseAddPath(Path src)
Path in a reverse direction.src - Indicates the specified path to add.public void offset(float offsetX,
float offsetY,
Path dst)
Path by a specified distance.offsetX - Indicates the horizontal offset of this Path.offsetY - Indicates the vertical offset of this Path.dst - Indicates the destination path after the offset.public boolean getLastPoint(Point point)
Path.point - Indicates the obtained point. If the operation fails, this parameter is null.true if the last point is obtained; returns false otherwise.public void setLastPoint(Point point)
Path.point - Indicates the coordinates of the last point to set.public boolean contains(float xCoor,
float yCoor)
Path.xCoor - Indicates the x-coordinate of the point.yCoor - Indicates the y-coordinate of the point.true if the specified point is contained in the area enclosed by this Path;
returns false otherwise.public boolean isValid()
Path is valid.
A path is considered to be valid if the data value regarding this Path is within the specified range,
the storage and dimension of the point array are matched and it is so with the verb array.
true if this Path is valid; returns false otherwise.public int countVerbs()
Path.
A verb array is an internal structure of a path. The array stores the points in the point array for performing
operations. For example, a point array includes two points a and b, which are described as
Move_Verb and Line_Verb, respectively in the verb array, then the drawing result is a straight
line from a to b.
public void updateBoundsCache()
Path.
You can use this method to improve the efficiency of calculating path bounds.