drawing_point.h
Overview
This file declares the functions related to the coordinate point in the drawing module.
File to include: <native_drawing/drawing_point.h>
Library: libnative_drawing.so
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 11
Related module: Drawing
Summary
Functions
| Name | Description |
|---|---|
| OH_Drawing_Point* OH_Drawing_PointCreate(float x, float y) | Creates an OH_Drawing_Point object. |
| OH_Drawing_ErrorCode OH_Drawing_PointGetX(const OH_Drawing_Point* point, float* x) | Obtains the X coordinate of a point. |
| OH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float* y) | Obtains the Y coordinate of a point. |
| OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y) | Sets the X and Y coordinates of a point. |
| void OH_Drawing_PointDestroy(OH_Drawing_Point* point) | Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object. |
Function Description
OH_Drawing_PointCreate()
OH_Drawing_Point* OH_Drawing_PointCreate(float x, float y)
Description
Creates an OH_Drawing_Point object.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 11
Parameters
| Name | Description |
|---|---|
| float x | X coordinate of the point. |
| float y | Y coordinate of the point. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_Point* | Returns the pointer to the OH_Drawing_Point object created. |
OH_Drawing_PointGetX()
OH_Drawing_ErrorCode OH_Drawing_PointGetX(const OH_Drawing_Point* point, float* x)
Description
Obtains the X coordinate of a point.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| const OH_Drawing_Point* point | Pointer to an OH_Drawing_Point object. |
| float* x | Pointer to the X coordinate. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_ErrorCode | Returns one of the following result codes: OH_DRAWING_SUCCESS if the operation is successful. OH_DRAWING_ERROR_INVALID_PARAMETER if either point or x is NULL. |
OH_Drawing_PointGetY()
OH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float* y)
Description
Obtains the Y coordinate of a point.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| const OH_Drawing_Point* point | Pointer to an OH_Drawing_Point object. |
| float* y | Pointer to the Y coordinate. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_ErrorCode | Returns one of the following result codes: OH_DRAWING_SUCCESS if the operation is successful. OH_DRAWING_ERROR_INVALID_PARAMETER if either point or y is NULL. |
OH_Drawing_PointSet()
OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y)
Description
Sets the X and Y coordinates of a point.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_Drawing_Point* point | Pointer to an OH_Drawing_Point object. |
| float x | Pointer to the X coordinate. |
| float y | Pointer to the Y coordinate. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_ErrorCode | Returns one of the following result codes: OH_DRAWING_SUCCESS if the operation is successful. OH_DRAWING_ERROR_INVALID_PARAMETER if point is NULL. |
OH_Drawing_PointDestroy()
void OH_Drawing_PointDestroy(OH_Drawing_Point* point)
Description
Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 11
Parameters
| Name | Description |
|---|---|
| OH_Drawing_Point* point | Pointer to an OH_Drawing_Point object. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-drawing-gpu-context-h
openharmony 鸿蒙 capi-drawing-nativepixelmap-
openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange
openharmony 鸿蒙 capi-drawing-oh-drawing-brush
openharmony 鸿蒙 capi-drawing-oh-drawing-image-info
openharmony 鸿蒙 capi-drawing-text-linetypography-h
openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage
openharmony 鸿蒙 capi-drawing-typeface-h