harmony 鸿蒙drawing_path.h
drawing_path.h
Overview
The drawing_path.h file declares the functions related to the path in the drawing module.
File to include: <native_drawing/drawing_path.h>
Library: libnative_drawing.so
Since: 8
Related module: Drawing
Summary
Types
Name | Description |
---|---|
typedef enum OH_Drawing_PathDirection OH_Drawing_PathDirection | Defines an enum for the directions of a closed contour. |
typedef enum OH_Drawing_PathFillType OH_Drawing_PathFillType | Defines an enum for the fill types of a path. |
typedef enum OH_Drawing_PathAddMode OH_Drawing_PathAddMode | Defines an enum for the path adding modes. |
typedef enum OH_Drawing_PathOpMode OH_Drawing_PathOpMode | Defines an enum for the operation modes available for a path. |
typedef enum OH_Drawing_PathMeasureMatrixFlags OH_Drawing_PathMeasureMatrixFlags | Defines an enum for the types of matrix information obtained during path measurement. |
Enums
Name | Description |
---|---|
OH_Drawing_PathDirection { PATH_DIRECTION_CW, PATH_DIRECTION_CCW } | Enumerates the directions of a closed contour. |
OH_Drawing_PathFillType { PATH_FILL_TYPE_WINDING, PATH_FILL_TYPE_EVEN_ODD, PATH_FILL_TYPE_INVERSE_WINDING, PATH_FILL_TYPE_INVERSE_EVEN_ODD } | Enumerates the fill types of a path. |
OH_Drawing_PathAddMode { PATH_ADD_MODE_APPEND, PATH_ADD_MODE_EXTEND } | Enumerates the path adding modes. |
OH_Drawing_PathOpMode { PATH_OP_MODE_DIFFERENCE, PATH_OP_MODE_INTERSECT, PATH_OP_MODE_UNION, PATH_OP_MODE_XOR, PATH_OP_MODE_REVERSE_DIFFERENCE } |
Enumerates the operation modes available for a path. |
OH_Drawing_PathMeasureMatrixFlags { GET_POSITION_MATRIX, GET_TANGENT_MATRIX, GET_POSITION_AND_TANGENT_MATRIX } | Enumerates the types of matrix information obtained during path measurement. |
Functions
Name | Description |
---|---|
OH_Drawing_ErrorCode OH_Drawing_PathGetSegment (OH_Drawing_Path *path, bool forceClosed, float start, float stop, bool startWithMoveTo, OH_Drawing_Path *dst, bool *result) | Extracts a segment of a path and appends it to a destination path. |
OH_Drawing_Path * OH_Drawing_PathCreate (void) | Creates an OH_Drawing_Path object. |
OH_Drawing_Path * OH_Drawing_PathCopy (OH_Drawing_Path *) | Copies an existing OH_Drawing_Path object to create a new one. |
void OH_Drawing_PathDestroy (OH_Drawing_Path *) | Destroys an OH_Drawing_Path object and reclaims the memory occupied by the object. |
void OH_Drawing_PathMoveTo (OH_Drawing_Path *, float x, float y) | Sets the start point of a path. |
void OH_Drawing_PathLineTo (OH_Drawing_Path *, float x, float y) | Draws a line segment from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathArcTo (OH_Drawing_Path *, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) | Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle is specified first, and then a start angle and a sweep angle are specified. The inscribed ellipse of the rectangle will be used to intercept the arc. The arc is a portion of the ellipse defined by the start angle and the sweep angle. If the path is empty, a line segment from the last point of the path to the start point of the arc is also added. |
void OH_Drawing_PathQuadTo (OH_Drawing_Path *, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathConicTo (OH_Drawing_Path *, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathCubicTo (OH_Drawing_Path *, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathRMoveTo (OH_Drawing_Path *, float x, float y) | Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathRLineTo (OH_Drawing_Path *, float x, float y) | Draws a line segment from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathRQuadTo (OH_Drawing_Path *, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathRConicTo (OH_Drawing_Path *, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathRCubicTo (OH_Drawing_Path *, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. |
void OH_Drawing_PathAddRect (OH_Drawing_Path *, float left, float top, float right, float bottom, OH_Drawing_PathDirection) | Adds a rectangle contour to a path in the specified direction. |
void OH_Drawing_PathAddRectWithInitialCorner (OH_Drawing_Path *, const OH_Drawing_Rect *, OH_Drawing_PathDirection, uint32_t start) | Adds a rectangle contour to a path in the specified direction. |
void OH_Drawing_PathAddRoundRect (OH_Drawing_Path *, const OH_Drawing_RoundRect *roundRect, OH_Drawing_PathDirection) | Adds a rounded rectangle contour to a path in the specified direction. |
void OH_Drawing_PathAddOvalWithInitialPoint (OH_Drawing_Path *, const OH_Drawing_Rect *, uint32_t start, OH_Drawing_PathDirection) | Adds an oval to a path. OH_Drawing_Rect specifies the outer tangent rectangle of the oval, and OH_Drawing_PathDirection specifies whether the drawing is clockwise or anticlockwise. |
void OH_Drawing_PathAddArc (OH_Drawing_Path *, const OH_Drawing_Rect *, float startAngle, float sweepAngle) | Adds an arc to a path as the start of a new contour. The arc added is part of the inscribed ellipse of the rectangle, from the start angle through the sweep angle. If the sweep angle is less than or equal to -360°, or if the sweep angle is greater than or equal to 360°, and start angle modulo 90 is nearly zero, an oval instead of an ellipse is added. |
void OH_Drawing_PathAddPath (OH_Drawing_Path *, const OH_Drawing_Path *src, const OH_Drawing_Matrix *) | Transforms the points in a src path by a matrix and adds the new one to the current path. |
void OH_Drawing_PathAddPathWithMatrixAndMode (OH_Drawing_Path *path, const OH_Drawing_Path *src, const OH_Drawing_Matrix *, OH_Drawing_PathAddMode) | Transforms the points in a src path by a matrix and adds the new one to the current path with the specified adding mode. |
void OH_Drawing_PathAddPathWithMode (OH_Drawing_Path *path, const OH_Drawing_Path *src, OH_Drawing_PathAddMode) | Adds a src path to the current path with the specified adding mode. |
void OH_Drawing_PathAddPathWithOffsetAndMode (OH_Drawing_Path *path, const OH_Drawing_Path *src, float dx, float dy, OH_Drawing_PathAddMode) | Translates a src path by an offset and adds the new one to the current path with the specified adding mode. |
void OH_Drawing_PathAddOval (OH_Drawing_Path *, const OH_Drawing_Rect *, OH_Drawing_PathDirection) | Adds an oval to a path in the specified direction. |
bool OH_Drawing_PathContains (OH_Drawing_Path *, float x, float y) | Checks whether a coordinate point is included in this path. For details, see OH_Drawing_PathFillType. |
void OH_Drawing_PathTransform (OH_Drawing_Path *, const OH_Drawing_Matrix *) | Transforms the points in a path by a matrix. |
void OH_Drawing_PathTransformWithPerspectiveClip (OH_Drawing_Path *src, const OH_Drawing_Matrix *, OH_Drawing_Path *dst, bool applyPerspectiveClip) | Transforms the points in a src path by a matrix and uses the new one to replace the dst path. If dst is NULL, the src path is replaced. |
void OH_Drawing_PathSetFillType (OH_Drawing_Path *, OH_Drawing_PathFillType) | Sets the fill type for a path. |
float OH_Drawing_PathGetLength (OH_Drawing_Path *, bool forceClosed) | Obtains the length of a path. |
void OH_Drawing_PathClose (OH_Drawing_Path *) | Closes a path by drawing a line segment from the current point to the start point of the path. |
void OH_Drawing_PathOffset (OH_Drawing_Path *path, OH_Drawing_Path *dst, float dx, float dy) | Translates a path by an offset along the x axis and y axis and adds the new one to the dst path. |
void OH_Drawing_PathReset (OH_Drawing_Path *) | Resets path data. |
void OH_Drawing_PathAddPolygon (OH_Drawing_Path *path, const OH_Drawing_Point2D *points, uint32_t count, bool isClosed) | Adds a polygon to a path. |
void OH_Drawing_PathAddCircle (OH_Drawing_Path *path, float x, float y, float radius, OH_Drawing_PathDirection) | Adds a circle to a path in the specified direction. |
bool OH_Drawing_PathBuildFromSvgString (OH_Drawing_Path *path, const char *str) | Parses the path represented by an SVG string. |
void OH_Drawing_PathGetBounds (OH_Drawing_Path *, OH_Drawing_Rect *) | Obtains the minimum bounds that enclose a path. |
bool OH_Drawing_PathIsClosed (OH_Drawing_Path *path, bool forceClosed) | Checks whether a path is closed. |
bool OH_Drawing_PathGetPositionTangent (OH_Drawing_Path *path, bool forceClosed, float distance, OH_Drawing_Point2D *position, OH_Drawing_Point2D *tangent) | Obtains the coordinates and tangent at a distance from the start point of a path. |
bool OH_Drawing_PathOp (OH_Drawing_Path *path, const OH_Drawing_Path *other, OH_Drawing_PathOpMode op) | Combines two paths based on the specified operation mode. |
bool OH_Drawing_PathGetMatrix (OH_Drawing_Path *path, bool forceClosed, float distance, OH_Drawing_Matrix *matrix, OH_Drawing_PathMeasureMatrixFlags flag) | Obtains a transformation matrix at a distance from the start point of a path. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙DisplaySoloist_ExpectedRateRange
harmony 鸿蒙NativeColorSpaceManager
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦