Declares the APIs of NativeRender, which allows you to create and manage render nodes, set rendering attributes, customize drawing content, and configure masking, clipping, and blurring effects. These APIs are applicable to scenarios where you need to build and manage custom render node trees and extend custom drawing effects on the native side. For details, see Building a Rendering Node.
File to include: <arkui/native_render.h>
Library: libace_ndk.z.so
System capability: SystemCapability.ArkUI.ArkUI.Full
Since: 20
Related module: ArkUI_RenderNodeUtils
Sample: NativeRenderNodeSample
| Name | typedef Keyword | Description |
|---|---|---|
| ArkUI_RenderNode* | ArkUI_RenderNodeHandle | Defines the pointer to a render node, which is used to represent and pass the render node object in ArkUI_RenderNodeUtils APIs. |
| ArkUI_RenderContentModifier* | ArkUI_RenderContentModifierHandle | Defines the pointer to a render content modifier, which is used to reference the content modifier. The content modifier can be mounted to a render node and attached with render attributes or set with the onDraw callback. |
| ArkUI_FloatProperty* | ArkUI_FloatPropertyHandle | Defines the pointer to an ArkUI native floating-point render property, which is used to create, transfer, and manage floating-point properties on the target content modifier. |
| ArkUI_Vector2Property* | ArkUI_Vector2PropertyHandle | Defines the pointer to a two-dimensional vector property, which is used to create, attach, set, obtain, and release a two-dimensional vector property in the ArkUI native rendering property API. |
| ArkUI_ColorProperty* | ArkUI_ColorPropertyHandle | Defines the pointer to a color property, which is used to represent the color property in ArkUI. |
| ArkUI_FloatAnimatableProperty* | ArkUI_FloatAnimatablePropertyHandle | Defines an animatable float property pointer. |
| ArkUI_Vector2AnimatableProperty* | ArkUI_Vector2AnimatablePropertyHandle | Defines an animatable 2D vector property pointer. |
| ArkUI_ColorAnimatableProperty* | ArkUI_ColorAnimatablePropertyHandle | Defines an animatable color property pointer. |
| ArkUI_RectShape | ArkUI_RectShapeOption | Defines a rectangle shape option, which is used to describe the shape range of a rectangle or an ellipse in an ArkUI render node. It can be used as the input for creating a mask or clipping option. |
| ArkUI_NodeBorderStyle | ArkUI_NodeBorderStyleOption | Defines a border style option, which is used to set the style type of the node border. Multiple styles are supported, such as the solid line, dotted line, and dashed line. |
| ArkUI_NodeBorderWidth | ArkUI_NodeBorderWidthOption | Defines a border width option, which is used to set the border width of each side of the render node. |
| ArkUI_NodeBorderColor | ArkUI_NodeBorderColorOption | Defines a node border color option, which is used to set the border color of the render node by side direction. |
| ArkUI_NodeBorderRadius | ArkUI_NodeBorderRadiusOption | Defines a node border radius configuration. |
| ArkUI_CircleShape | ArkUI_CircleShapeOption | Defines a circle shape option, which is used to create a circle shape in ArkUI_RenderNodeUtils and configure the circle center coordinates and radius as the mask or clipping shape of the render node. |
| ArkUI_RoundRectShape | ArkUI_RoundRectShapeOption | Defines a rounded rectangle shape option, which is used to configure a rounded rectangle shape and can be used to create a mask or clipping for a render node. |
| ArkUI_CommandPath | ArkUI_CommandPathOption | Defines a custom drawing path option, which is used to create a path-based mask or clipping effect for a render node. |
| ArkUI_RenderNodeMaskOption | ArkUI_RenderNodeMaskOption | Defines a render node mask option, which is used to describe the mask area of a render node using a rectangle, rounded rectangle, circle, ellipse, or custom drawing path, and apply the mask to the render node as the input parameter of OH_ArkUI_RenderNodeUtils_SetMask. |
| ArkUI_RenderNodeClipOption | ArkUI_RenderNodeClipOption | Defines a render node clipping option, which is used to describe the clipping area of a render node using a rectangle, rounded rectangle, circle, ellipse, or custom drawing path, and apply the clipping to the render node as the input parameter of OH_ArkUI_RenderNodeUtils_SetClip. |
| ArkUI_RenderBlurStyleOption | ArkUI_RenderBlurStyleOption | Defines a blur style configuration. |
int32_t OH_ArkUI_RenderNodeUtils_AddRenderNode(ArkUI_NodeHandle node, ArkUI_RenderNodeHandle child)
Description
Adds a child render node to the parent custom node.
The parent node supports only the nodes of the ARKUI_NODE_CUSTOM type in ArkUI_NodeType. By default, when the OH_ARKUI_NODE_MOUNT_POLICY_SINGLE_IF_RENDER_NODE mount policy is used, a custom node can mount only one child render node and cannot mount child nodes of other types at the same time. Since API version 26.0.0, you can set the mount policy to OH_ARKUI_NODE_MOUNT_POLICY_MIXED using OH_ArkUI_NativeModule_SetChildMountPolicy to support mixed mounting of multiple child nodes.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target parent node. |
| ArkUI_RenderNodeHandle child | Child render node to be added. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_NOT_CUSTOM_NODE if the target node is not a custom node. Returns ARKUI_ERROR_CODE_CHILD_EXISTED if the parent node already has a child node when a non-OH_ARKUI_NODE_MOUNT_POLICY_MIXED mount policy is used. Returns ARKUI_ERROR_CODE_RENDER_PARENT_EXISTED if the target render node has a parent node. Returns ARKUI_ERROR_CODE_RENDER_HAS_INVALID_FRAME_NODE if the current render node originates from a FrameNode that has been either detached as a child node or destroyed. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_RemoveRenderNode(ArkUI_NodeHandle node, ArkUI_RenderNodeHandle child)
Description
Removes the specified child render node from the parent node.
The parent node supports only the nodes of the ARKUI_NODE_CUSTOM type in ArkUI_NodeType.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target parent node. |
| ArkUI_RenderNodeHandle child | Child render node to be removed. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_NOT_CUSTOM_NODE if the target node is not a custom node. |
int32_t OH_ArkUI_RenderNodeUtils_ClearRenderNodeChildren(ArkUI_NodeHandle node)
Description
Clears child render nodes in the parent node.
The parent node supports only the nodes of the ARKUI_NODE_CUSTOM type in ArkUI_NodeType.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target parent node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_NOT_CUSTOM_NODE if the target node is not a custom node. |
int32_t OH_ArkUI_RenderNodeUtils_Invalidate(ArkUI_NodeHandle node)
Description
Marks the target node, triggering its lifecycle and child nodes to re-render.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
ArkUI_RenderNodeHandle OH_ArkUI_RenderNodeUtils_CreateNode()
Description
Creates a render node.
After using the render node, call OH_ArkUI_RenderNodeUtils_DisposeNode to destroy it and release the resources.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeHandle | Target render node. |
int32_t OH_ArkUI_RenderNodeUtils_DisposeNode(ArkUI_RenderNodeHandle node)
Description
Destroys the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AddChild(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle child)
Description
Adds a child node to the target parent render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| ArkUI_RenderNodeHandle child | Child render node to be added. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. Returns ARKUI_ERROR_CODE_RENDER_HAS_INVALID_FRAME_NODE if the current render node originates from a FrameNode that has been either detached as a child node or destroyed. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_InsertChildAfter(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle child, ArkUI_RenderNodeHandle sibling)
Description
Adds a child node after the target child node of the parent node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| ArkUI_RenderNodeHandle child | Child render node to be added. |
| ArkUI_RenderNodeHandle sibling | Target child node, which is used to determine the reference sibling render node of the insertion position. If the node is not in the current child node list of node, the node is appended to the end. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. Returns ARKUI_ERROR_CODE_RENDER_HAS_INVALID_FRAME_NODE if the current render node originates from a FrameNode that has been either detached as a child node or destroyed. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_RemoveChild(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle child)
Description
Removes a child node from the specified render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| ArkUI_RenderNodeHandle child | Child render node to be removed. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_ClearChildren(ArkUI_RenderNodeHandle node)
Description
Clears all child nodes of the specified render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetChild(ArkUI_RenderNodeHandle node, int32_t index, ArkUI_RenderNodeHandle* child)
Description
Obtains the child node at the specified index.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| int32_t index | Index of the child node. The value range is [0, Number of child nodes – 1]. If the index is less than 0, ARKUI_ERROR_CODE_PARAM_INVALID is returned. If the index is greater than or equal to the number of child nodes, ARKUI_ERROR_CODE_RENDER_CHILD_NOT_EXIST is returned. |
| ArkUI_RenderNodeHandle* child | Render node pointer used to receive the child node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_CHILD_NOT_EXIST if the corresponding render child node is not found. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetFirstChild(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle* child)
Description
Obtains the first child node of the specified render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_RenderNodeHandle* child | Render node pointer used to receive the first child node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_CHILD_NOT_EXIST if the corresponding render child node is not found. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetNextSibling(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle* sibling)
Description
Obtains the next sibling node of the specified node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Reference node. |
| ArkUI_RenderNodeHandle* sibling | Pointer to the render node, which is used to receive the next sibling node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_CHILD_NOT_EXIST if the corresponding render child node is not found. |
int32_t OH_ArkUI_RenderNodeUtils_GetPreviousSibling(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle* sibling)
Description
Obtains the previous sibling node of the specified node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Reference node. |
| ArkUI_RenderNodeHandle* sibling | Pointer to the render node, which is used to receive the previous sibling node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_CHILD_NOT_EXIST if the corresponding render child node is not found. |
int32_t OH_ArkUI_RenderNodeUtils_GetChildren(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeHandle** children, int32_t* count)
Description
Obtains all child render nodes of the parent render node.
The caller is responsible for releasing the returned child node array.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| ArkUI_RenderNodeHandle** children | Pointer array used to store all child render nodes. |
| int32_t* count | Pointer used to store the number of obtained child nodes. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetChildrenCount(ArkUI_RenderNodeHandle node, int32_t* count)
Description
Obtains the number of child render nodes of the specified render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target parent render node. |
| int32_t* count | Pointer used to store the number of child nodes. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBackgroundColor(ArkUI_RenderNodeHandle node, uint32_t color)
Description
Sets the background color for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| uint32_t color | ARGB color value (32-bit unsigned integer). Default value: 0x00000000. Description of color byte layout: - Bits 24-31: alpha channel (0x00 for fully transparent, 0xFF for fully opaque). - Bits 16-23: red channel. - Bits 8-15: green channel. - Bits 0-7: blue channel. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBackgroundColor(ArkUI_RenderNodeHandle node, uint32_t* color)
Description
Obtains the background color of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| uint32_t* color | Integer pointer used to store the obtained ARGB color value. Default value: 0x00000000. Description of color byte layout: - Bits 24-31: alpha channel (0x00 for fully transparent, 0xFF for fully opaque). - Bits 16-23: red channel. - Bits 8-15: green channel. - Bits 0-7: blue channel. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetClipToFrame(ArkUI_RenderNodeHandle node, int32_t clipToFrame)
Description
Sets whether to clip the render node based on the frame area.
The frame area is determined by the node size and position. Different from OH_ArkUI_RenderNodeUtils_SetClipToBounds, which clips the render node based on the node bounds (rounded corner bounds are used when rounded corners are configured), this API always uses the frame rectangle. To clip the render node based on a custom shape, use OH_ArkUI_RenderNodeUtils_SetClip. If this parameter is set to 1, the content that exceeds the clipping area will be clipped.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t clipToFrame | Whether to clip the render node based on the frame area. 1: yes; 0: no. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetClipToFrame(ArkUI_RenderNodeHandle node, int32_t* clipToFrame)
Description
Obtains whether the render node is clipped based on the frame area.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* clipToFrame | Pointer used to receive the state value indicating whether the render node is clipped based on the frame area. 1: The render node is clipped based on the frame area; 0: The render node is not clipped based on the frame area. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetClipToBounds(ArkUI_RenderNodeHandle node, int32_t clipToBounds)
Description
Sets whether to clip the render node based on its bounds.
When rounded corners are configured for a node, the rounded corner bounds are used. When this parameter is set to 1, the content that exceeds the clipping area will be clipped.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t clipToBounds | Whether to clip the render node based on its bounds. 1: yes; 0: no. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetClipToBounds(ArkUI_RenderNodeHandle node, int32_t* clipToBounds)
Description
Obtains whether the render node is clipped based on its bounds.
When rounded corners are configured for a node, the rounded corner bounds are used.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* clipToBounds | Pointer used to receive the state value indicating whether the render node is clipped based on its bounds. 1: The render node is clipped based on its bounds; 0: The render node is not clipped based on its bounds. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetOpacity(ArkUI_RenderNodeHandle node, float opacity)
Description
Sets the opacity value for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float opacity | Opacity value (0.0–1.0). Default value: 1. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetOpacity(ArkUI_RenderNodeHandle node, float* opacity)
Description
Obtains the opacity value of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* opacity | Pointer used to store the opacity value (0.0–1.0). Default value: 1. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetSize(ArkUI_RenderNodeHandle node, int32_t width, int32_t height)
Description
Sets the size for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t width | Width, in px. Default value: 0. The value must be greater than or equal to 0. If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
| int32_t height | Height, in px. Default value: 0. The value must be greater than or equal to 0. If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetSize(ArkUI_RenderNodeHandle node, int32_t* width, int32_t* height)
Description
Obtains the size of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* width | Pointer used to receive the width value, in px. The value range is [0, INT_MAX]. Default value: 0. |
| int32_t* height | Pointer used to receive the height value, in px. The value range is [0, INT_MAX]. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetPosition(ArkUI_RenderNodeHandle node, int32_t x, int32_t y)
Description
Sets the position coordinates for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t x | X-coordinate (in px). Default value: 0, in px. |
| int32_t y | Y-coordinate (in px). Default value: 0, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetPosition(ArkUI_RenderNodeHandle node, int32_t* x, int32_t* y)
Description
Obtains the position coordinates of the render node. The coordinates are the position offset of the render node relative to its parent node after the parent node lays out the node. The unit is px. The offset attribute that takes effect after the layout and the position attribute that does not participate in the layout do not affect the coordinates.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* x | Pointer used to store the x-coordinate (in px). Default value: 0, in px. |
| int32_t* y | Pointer used to store the y-coordinate (in px). Default value: 0, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetPivot(ArkUI_RenderNodeHandle node, float x, float y)
Description
Sets the pivot point for the transformation of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float x | Normalized X-coordinate of the pivot point. The value range is [0.0, 1.0]. The API does not verify this range. If the value is out of range, the input value is still used. Default value: 0.5. |
| float y | Normalized Y-coordinate of the pivot point. The value range is [0.0, 1.0]. The API does not verify this range. If the value is out of range, the input value is still used. Default value: 0.5. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetPivot(ArkUI_RenderNodeHandle node, float* x, float* y)
Description
Obtains the pivot point coordinates of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* x | Pointer used to store the x-coordinate of the pivot point. Default value: 0.5. |
| float* y | Pointer used to store the y-coordinate of the pivot point. Default value: 0.5. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetScale(ArkUI_RenderNodeHandle node, float x, float y)
Description
Sets the scale factors for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float x | Scale factor on the x-axis. Default value: 1. |
| float y | Scale factor on the y-axis. Default value: 1. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetScale(ArkUI_RenderNodeHandle node, float* x, float* y)
Description
Obtains the scale factors of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* x | Pointer used to store the scale factor on the x-axis. Default value: 1. |
| float* y | Pointer used to store the scale factor on the y-axis. Default value: 1. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetTranslation(ArkUI_RenderNodeHandle node, float x, float y)
Description
Sets the translation offset for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float x | Horizontal translation offset (in pixels). Default value: 0. |
| float y | Vertical translation offset (in pixels). Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetTranslation(ArkUI_RenderNodeHandle node, float* x, float* y)
Description
Obtains the translation offset of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* x | Pointer used to receive the horizontal translation offset, in px. Default value: 0. |
| float* y | Pointer used to receive the vertical translation offset, in px. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetRotation(ArkUI_RenderNodeHandle node, float x, float y, float z)
Description
Sets the rotation angles for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float x | Rotation angle around the x-axis (in degrees). Default value: 0. |
| float y | Rotation angle around the y-axis (in degrees). Default value: 0. |
| float z | Rotation angle around the z-axis (in degrees). Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetRotation(ArkUI_RenderNodeHandle node, float* x, float* y, float* z)
Description
Obtains the rotation angles of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* x | Pointer used to store the rotation angle around the x-axis (in degrees). Default value: 0. |
| float* y | Pointer used to store the rotation angle around the y-axis (in degrees). Default value: 0. |
| float* z | Pointer used to store the rotation angle around the z-axis (in degrees). Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetTransform(ArkUI_RenderNodeHandle node, float* matrix)
Description
Sets the transformation matrix for the render node.
This API is used to control the scaling, rotation, translation, skewing, and perspective projection effects of a render node using a 4 x 4 matrix.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* matrix | Float array of 4x4 transformation matrix (16 consecutive values). |
The transformation matrix must be provided as 16 consecutive float values in row-major order:
[m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
m30, m31, m32, m33]
The matrix is represented as follows:
| m00 m01 m02 m03 |
| m10 m11 m12 m13 |
| m20 m21 m22 m23 |
| m30 m31 m32 m33 |
Matrix components:
| Matrix Element | Description |
|---|---|
| m00 | Scale value for the x-axis. The default value is 1 in the identity matrix. |
| m01 | Second value, affected by rotation or skewing around x, y, z axes. |
| m02 | Third value, affected by rotation around x, y, z axes. |
| m03 | Fourth value, affected by perspective projection. |
| m10 | Fifth value, affected by rotation or skewing around x, y, z axes. |
| m11 | Scale value for the y-axis. The default value is 1 in the identity matrix. |
| m12 | Seventh value, affected by rotation around x, y, z axes. |
| m13 | Eighth value, affected by perspective projection. |
| m20 | Ninth value, affected by rotation around x, y, z axes. |
| m21 | Tenth value, affected by rotation around x, y, z axes. |
| m22 | Scale value for the z-axis. The default value is 1 in the identity matrix. |
| m23 | Twelfth value, affected by perspective projection. |
| m30 | Translation value for the x-axis (in px). The default value is 0 in the identity matrix. |
| m31 | Translation value for the y-axis (in px). The default value is 0 in the identity matrix. |
| m32 | Translation value for the z-axis (in px). The default value is 0 in the identity matrix. |
| m33 | Valid in homogeneous coordinates, producing perspective projection effects. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetShadowColor(ArkUI_RenderNodeHandle node, uint32_t color)
Description
Sets the shadow color for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| uint32_t color | ARGB color value (32-bit unsigned integer). Default value: 0x00000000. Description of color byte layout: - Bits 24-31: alpha channel (0x00 for fully transparent, 0xFF for fully opaque). - Bits 16-23: red channel. - Bits 8-15: green channel. - Bits 0-7: blue channel. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetShadowColor(ArkUI_RenderNodeHandle node, uint32_t* color)
Description
Obtains the shadow color of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| uint32_t* color | Integer pointer used to receive the ARGB color value. If the shadow color is not set, the received value is 0x00000000 (fully transparent). Description of color byte layout: - Bits 24-31: alpha channel (0x00 for fully transparent, 0xFF for fully opaque). - Bits 16-23: red channel. - Bits 8-15: green channel. - Bits 0-7: blue channel. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetShadowOffset(ArkUI_RenderNodeHandle node, int32_t x, int32_t y)
Description
Sets the shadow offset for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t x | Horizontal offset (in pixels). Default value: 0. |
| int32_t y | Vertical offset (in pixels). Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetShadowOffset(ArkUI_RenderNodeHandle node, int32_t* x, int32_t* y)
Description
Obtains the shadow offset of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* x | Pointer used to store the horizontal offset. Default value: 0, in px. |
| int32_t* y | Pointer used to store the vertical offset. Default value: 0, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetShadowAlpha(ArkUI_RenderNodeHandle node, float alpha)
Description
Sets the shadow alpha (transparency) for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float alpha | Alpha channel of the shadow. The value range is [0.0, 1.0]. If a value beyond the range is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetShadowAlpha(ArkUI_RenderNodeHandle node, float* alpha)
Description
Obtains the shadow alpha (transparency) of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* alpha | Pointer used to receive the alpha channel of the shadow. If no shadow-related attribute is set, the received value is -1.0, indicating that no attribute is configured. After a shadow-related attribute is set, the received value ranges from 0.0 to 1.0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetShadowElevation(ArkUI_RenderNodeHandle node, float elevation)
Description
Sets the shadow elevation for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float elevation | Shadow elevation, in px. The value range is [0, +∞). If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetShadowElevation(ArkUI_RenderNodeHandle node, float* elevation)
Description
Obtains the shadow elevation of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* elevation | Pointer used to receive the shadow elevation value, in px. The value range is [0, +∞). If the shadow elevation is not set, the received value is 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetShadowRadius(ArkUI_RenderNodeHandle node, float radius)
Description
Sets the shadow radius for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float radius | Shadow radius, in px. The value range is [0, +∞). If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetShadowRadius(ArkUI_RenderNodeHandle node, float* radius)
Description
Obtains the shadow radius of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float* radius | Pointer used to receive the shadow radius, in px. After the shadow radius is set, the received value range is [0, +∞). If the shadow radius is not set, the received value is 0 in versions earlier than API 26.0.0 and -1 since API 26.0.0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBorderStyle(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderStyleOption* borderStyle)
Description
Sets the border style for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderStyleOption* borderStyle | Pointer to the border style. Default value in the struct pointer: ARKUI_BORDER_STYLE_SOLID. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBorderStyle(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderStyleOption** borderStyle)
Description
Obtains the border style of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderStyleOption** borderStyle | Pointer used to store the border style. Default value in the struct pointer: ARKUI_BORDER_STYLE_SOLID. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBorderWidth(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderWidthOption* borderWidth)
Description
Sets the border width for the render node.
The border width must be less than the node size.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderWidthOption* borderWidth | Pointer to the border width. Default value in the struct pointer: 0. Unit: px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBorderWidth(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderWidthOption** borderWidth)
Description
Obtains the border width of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderWidthOption** borderWidth | Pointer used to store the border width. Default value in the struct pointer: 0. Unit: px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBorderColor(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderColorOption* borderColor)
Description
Sets the border color for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderColorOption* borderColor | Pointer to the border color. Default value in the struct pointer: 0x00000000. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBorderColor(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderColorOption** borderColor)
Description
Obtains the border color of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderColorOption** borderColor | Pointer used to store the border color. Default value in the struct pointer: 0x00000000. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBorderRadius(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderRadiusOption* borderRadius)
Description
Sets the border corner radius for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderRadiusOption* borderRadius | Pointer to the border radius. The default radius of each corner is 0, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBorderRadius(ArkUI_RenderNodeHandle node, ArkUI_NodeBorderRadiusOption** borderRadius)
Description
Obtains the border corner radius of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_NodeBorderRadiusOption** borderRadius | Pointer used to store the border corner radius. The default radius of each corner is 0, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetMask(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeMaskOption* mask)
Description
Applies a mask to the render node using the mask configuration.
The mask layer range is determined by the node boundary. The part of the mask shape that exceeds the node boundary is not displayed. Calling OH_ArkUI_RenderNodeUtils_SetDrawRegion will not expand the mask layer range.
The mask is created as follows:
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_RenderNodeMaskOption* mask | Pointer to the mask configuration. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetClip(ArkUI_RenderNodeHandle node, ArkUI_RenderNodeClipOption* clip)
Description
Applies clipping to the render node using the clipping configuration.
The clipping shape can exceed the node boundary. To display the drawing content outside the node boundary, call OH_ArkUI_RenderNodeUtils_SetDrawRegion to set the drawing area that covers the content. The final display is still affected by other clipping conditions.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_RenderNodeClipOption* clip | Pointer to the clipping configuration. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetMarkNodeGroup(ArkUI_RenderNodeHandle node, bool markNodeGroup)
Description
Sets whether to form a render group with the target node and its subtree.
If the markNodeGroup parameter is set to true, the system generates an offscreen cache that contains the node and its subtree to reuse the drawing result. This is applicable to scenarios where the subtree content is fixed and only the overall application animation is required. When this API is used together with screenshot, blur, brightness adjustment, or blending operations, display exceptions or performance deterioration may occur.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| bool markNodeGroup | Whether to form a node group with the target node and its subtree. true: form a node group and perform offscreen rendering; false: do not form a node group. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetBounds(ArkUI_RenderNodeHandle node, int32_t x, int32_t y, int32_t width, int32_t height)
Description
Sets the bounds for the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t x | X-coordinate of the upper left corner of the bounds, in pixels. Default value: 0. |
| int32_t y | Y-coordinate of the upper left corner of the bounds, in pixels. Default value: 0. |
| int32_t width | Width of the bounds (in pixels). Default value: 0. The value must be greater than or equal to 0. If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
| int32_t height | Height of the bounds (in pixels). Default value: 0. The value must be greater than or equal to 0. If a negative value is passed, ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE is returned. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE if the parameter value is out of range. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_GetBounds(ArkUI_RenderNodeHandle node, int32_t* x, int32_t* y, int32_t* width, int32_t* height)
Description
Obtains the bounds of the render node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| int32_t* x | Pointer used to store the x-coordinate of the upper left corner of the bounds, in pixels. Default value: 0. |
| int32_t* y | Pointer used to store the y-coordinate of the upper left corner of the bounds, in pixels. Default value: 0. |
| int32_t* width | Pointer used to store the width of the bound, in pixels. The value range is [0, INT_MAX]. Default value: 0. |
| int32_t* height | Pointer used to store the height of the bound, in pixels. The value range is [0, INT_MAX]. Default value: 0. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_SetDrawRegion(ArkUI_RenderNodeHandle node, float x, float y, float w, float h)
Description
Sets the drawing region for the render node.
The drawing area is defined by the x, y, w, and h coordinates in the local coordinate system of the node. This area is combined with the node's own range and is used to calculate the node's drawing range and dirty regions. If the drawing content exceeds the node's boundary, the area should cover the entire overflow. This API does not change the node's boundary or expand the mask layer's range.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| float x | X-coordinate of the upper left corner of the drawing area relative to the origin of the local coordinate system of the node, in px. |
| float y | Y-coordinate of the upper left corner of the drawing area relative to the origin of the local coordinate system of the node, in px. |
| float w | Width of the drawing area, in px. |
| float h | Height of the drawing area, in px. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
int32_t OH_ArkUI_RenderNodeUtils_AttachContentModifier(ArkUI_RenderNodeHandle node, ArkUI_RenderContentModifierHandle modifier)
Description
Attaches a content modifier to the render node.
This API is used to extend the custom drawing content of a node through the onDraw callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | Target render node. |
| ArkUI_RenderContentModifierHandle modifier | Content modifier. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. This specification is supported since API version 22. |
ArkUI_RenderContentModifierHandle OH_ArkUI_RenderNodeUtils_CreateContentModifier()
Description
Creates a content modifier.
This API is used to save the drawing attributes, set the onDraw callback, and attach the content modifier to the render node. After using the content modifier, call OH_ArkUI_RenderNodeUtils_DisposeContentModifier to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_RenderContentModifierHandle | Content modifier. |
void OH_ArkUI_RenderNodeUtils_DisposeContentModifier(ArkUI_RenderContentModifierHandle modifier)
Description
Disposes of the content modifier.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Content modifier. |
int32_t OH_ArkUI_RenderNodeUtils_AttachFloatProperty(ArkUI_RenderContentModifierHandle modifier, ArkUI_FloatPropertyHandle property)
Description
Attaches a float property to the target content modifier.
This API is used to pass or update floating-point drawing parameters in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_FloatPropertyHandle property | Float property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AttachVector2Property(ArkUI_RenderContentModifierHandle modifier, ArkUI_Vector2PropertyHandle property)
Description
Attaches a 2D vector property to the target content modifier.
This API is used to pass or update drawing parameters such as 2D coordinates and offsets in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_Vector2PropertyHandle property | 2D vector property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AttachColorProperty(ArkUI_RenderContentModifierHandle modifier, ArkUI_ColorPropertyHandle property)
Description
Attaches a color property to the target content modifier.
This API is used to pass or update color drawing parameters in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_ColorPropertyHandle property | Color property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AttachFloatAnimatableProperty(ArkUI_RenderContentModifierHandle modifier, ArkUI_FloatAnimatablePropertyHandle property)
Description
Attaches an animatable float property to the target content modifier.
This API is used to set floating-point drawing parameters that change with the animation in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_FloatAnimatablePropertyHandle property | Animatable float property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AttachVector2AnimatableProperty(ArkUI_RenderContentModifierHandle modifier, ArkUI_Vector2AnimatablePropertyHandle property)
Description
Attaches an animatable 2D vector property to the target content modifier.
This API is used to set drawing parameters such as 2D coordinates and offsets that change with the animation in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_Vector2AnimatablePropertyHandle property | Animatable 2D vector property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_AttachColorAnimatableProperty(ArkUI_RenderContentModifierHandle modifier, ArkUI_ColorAnimatablePropertyHandle property)
Description
Attaches an animatable color property to the target content modifier.
This API is used to set color drawing parameters that change with the animation in the drawing callback.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier to which the property is to be attached. |
| ArkUI_ColorAnimatablePropertyHandle property | Animatable color property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
ArkUI_FloatPropertyHandle OH_ArkUI_RenderNodeUtils_CreateFloatProperty(float value)
Description
Creates a float property.
After using the property, call OH_ArkUI_RenderNodeUtils_DisposeFloatProperty to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| float value | Property value. |
Return value
| Type | Description |
|---|---|
| ArkUI_FloatPropertyHandle | Float property. |
int32_t OH_ArkUI_RenderNodeUtils_SetFloatPropertyValue(ArkUI_FloatPropertyHandle property, float value)
Description
Sets the value of the float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatPropertyHandle property | Float property. |
| float value | Property value. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetFloatPropertyValue(ArkUI_FloatPropertyHandle property, float* value)
Description
Obtains the value of the float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatPropertyHandle property | Float property. |
| float* value | Pointer used to store the property value. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeFloatProperty(ArkUI_FloatPropertyHandle property)
Description
Disposes of the float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatPropertyHandle property | Float property. |
ArkUI_Vector2PropertyHandle OH_ArkUI_RenderNodeUtils_CreateVector2Property(float x, float y)
Description
Creates a 2D vector property.
After using the property, call OH_ArkUI_RenderNodeUtils_DisposeVector2Property to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| float x | X-coordinate of the property. |
| float y | Y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| ArkUI_Vector2PropertyHandle | 2D vector property. |
int32_t OH_ArkUI_RenderNodeUtils_SetVector2PropertyValue(ArkUI_Vector2PropertyHandle property, float x, float y)
Description
Sets the value of the 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2PropertyHandle property | 2D vector property. |
| float x | X-coordinate of the property. |
| float y | Y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetVector2PropertyValue(ArkUI_Vector2PropertyHandle property, float* x, float* y)
Description
Obtains the value of the 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2PropertyHandle property | 2D vector property. |
| float* x | Pointer used to store the x-coordinate of the property. |
| float* y | Pointer used to store the y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeVector2Property(ArkUI_Vector2PropertyHandle property)
Description
Disposes of the 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2PropertyHandle property | 2D vector property. |
ArkUI_ColorPropertyHandle OH_ArkUI_RenderNodeUtils_CreateColorProperty(uint32_t value)
Description
Creates a color property.
After using the property, call OH_ArkUI_RenderNodeUtils_DisposeColorProperty to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| uint32_t value | ARGB color value used to initialize the color property. The value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| ArkUI_ColorPropertyHandle | Color property. |
int32_t OH_ArkUI_RenderNodeUtils_SetColorPropertyValue(ArkUI_ColorPropertyHandle property, uint32_t value)
Description
Sets the value of the color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorPropertyHandle property | Color property. |
| uint32_t value | ARGB color value to be set. The value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetColorPropertyValue(ArkUI_ColorPropertyHandle property, uint32_t* value)
Description
Obtains the value of the color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorPropertyHandle property | Color property. |
| uint32_t* value | Pointer used to receive the ARGB color value. The color value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeColorProperty(ArkUI_ColorPropertyHandle property)
Description
Disposes of the color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorPropertyHandle property | Color property. |
ArkUI_FloatAnimatablePropertyHandle OH_ArkUI_RenderNodeUtils_CreateFloatAnimatableProperty(float value)
Description
Creates an animatable float property.
This API is used to save the float drawing parameters that can change with the animation. After using the property, call OH_ArkUI_RenderNodeUtils_DisposeFloatAnimatableProperty to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| float value | Property value. |
Return value
| Type | Description |
|---|---|
| ArkUI_FloatAnimatablePropertyHandle | Animatable float property. |
int32_t OH_ArkUI_RenderNodeUtils_SetFloatAnimatablePropertyValue(ArkUI_FloatAnimatablePropertyHandle property, float value)
Description
Sets the value of the animatable float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatAnimatablePropertyHandle property | Animatable float property. |
| float value | Property value. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetFloatAnimatablePropertyValue(ArkUI_FloatAnimatablePropertyHandle property, float* value)
Description
Obtains the value of the animatable float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatAnimatablePropertyHandle property | Animatable float property. |
| float* value | Pointer used to store the property value. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeFloatAnimatableProperty(ArkUI_FloatAnimatablePropertyHandle property)
Description
Disposes of the animatable float property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_FloatAnimatablePropertyHandle property | Animatable float property. |
ArkUI_Vector2AnimatablePropertyHandle OH_ArkUI_RenderNodeUtils_CreateVector2AnimatableProperty(float x, float y)
Description
Creates an animatable 2D vector property.
This API is used to save the drawing parameters such as 2D coordinates and offsets that can change with animation. After using the property, call OH_ArkUI_RenderNodeUtils_DisposeVector2AnimatableProperty to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| float x | X-coordinate of the property. |
| float y | Y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| ArkUI_Vector2AnimatablePropertyHandle | Animatable 2D vector property. |
int32_t OH_ArkUI_RenderNodeUtils_SetVector2AnimatablePropertyValue(ArkUI_Vector2AnimatablePropertyHandle property, float x, float y)
Description
Sets the value of the animatable 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2AnimatablePropertyHandle property | Animatable 2D vector property. |
| float x | X-coordinate of the property. |
| float y | Y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetVector2AnimatablePropertyValue(ArkUI_Vector2AnimatablePropertyHandle property, float* x, float* y)
Description
Obtains the value of the animatable 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2AnimatablePropertyHandle property | Animatable 2D vector property. |
| float* x | Pointer used to store the x-coordinate of the property. |
| float* y | Pointer used to store the y-coordinate of the property. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeVector2AnimatableProperty(ArkUI_Vector2AnimatablePropertyHandle property)
Description
Disposes of the animatable 2D vector property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_Vector2AnimatablePropertyHandle property | Animatable 2D vector property. |
ArkUI_ColorAnimatablePropertyHandle OH_ArkUI_RenderNodeUtils_CreateColorAnimatableProperty(uint32_t value)
Description
Creates an animatable color property.
This API is used to save the color drawing parameters that can change with the animation. After using the property, call OH_ArkUI_RenderNodeUtils_DisposeColorAnimatableProperty to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| uint32_t value | ARGB color value used to initialize the animatable color property. The value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| ArkUI_ColorAnimatablePropertyHandle | Animatable color property. |
int32_t OH_ArkUI_RenderNodeUtils_SetColorAnimatablePropertyValue(ArkUI_ColorAnimatablePropertyHandle property, uint32_t value)
Description
Sets the value of the animatable color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorAnimatablePropertyHandle property | Animatable color property. |
| uint32_t value | ARGB color value to be set. The value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_GetColorAnimatablePropertyValue(ArkUI_ColorAnimatablePropertyHandle property, uint32_t* value)
Description
Obtains the value of the animatable color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorAnimatablePropertyHandle property | Animatable color property. |
| uint32_t* value | Pointer used to receive the ARGB color value. The color value is in the format of 0xAARRGGBB, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
void OH_ArkUI_RenderNodeUtils_DisposeColorAnimatableProperty(ArkUI_ColorAnimatablePropertyHandle property)
Description
Disposes of the animatable color property.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_ColorAnimatablePropertyHandle property | Animatable color property. |
int32_t OH_ArkUI_RenderNodeUtils_SetContentModifierOnDraw(ArkUI_RenderContentModifierHandle modifier, void* userData, void (*callback)(ArkUI_DrawContext* context, void* userData))
Description
Sets the onDraw callback of the content modifier.
This callback is used to execute the custom drawing logic during the drawing phase of the content modifier.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderContentModifierHandle modifier | Target content modifier. |
| void* userData | Pointer to the custom data to be passed to the callback. |
| void (*callback)(ArkUI_DrawContext* context, void* userData) | Pointer to the callback for receiving drawing events. context indicates the drawing context, and userData indicates the custom data passed when this API is called. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
ArkUI_RectShapeOption* OH_ArkUI_RenderNodeUtils_CreateRectShapeOption()
Description
Creates a rectangle shape option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRectShapeOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_RectShapeOption* | Pointer to the rectangle shape option. |
void OH_ArkUI_RenderNodeUtils_DisposeRectShapeOption(ArkUI_RectShapeOption* option)
Description
Disposes of the rectangle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* option | Pointer to the rectangle shape option. |
void OH_ArkUI_RenderNodeUtils_SetRectShapeOptionEdgeValue(ArkUI_RectShapeOption* option, float edgeValue, ArkUI_EdgeDirection direction)
Description
Sets the edge value for the rectangle shape option.
The left or top edge can be a negative value, indicating that the corresponding edge is on the left or above the node origin. When the shape is used for masking, the part that exceeds the node boundary is not displayed. When the shape is used for clipping and the content outside the node boundary needs to be displayed, you need to use OH_ArkUI_RenderNodeUtils_SetDrawRegion to set the drawing area that covers the content.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* option | Pointer to the rectangle shape option. |
| float edgeValue | Edge value of the rectangle shape option, in px. |
| ArkUI_EdgeDirection direction | Edge direction to apply the value. |
ArkUI_NodeBorderStyleOption* OH_ArkUI_RenderNodeUtils_CreateNodeBorderStyleOption()
Description
Creates a node border style option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeNodeBorderStyleOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_NodeBorderStyleOption* | Pointer to the node border style option. |
void OH_ArkUI_RenderNodeUtils_DisposeNodeBorderStyleOption(ArkUI_NodeBorderStyleOption* option)
Description
Disposes of the node border style option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderStyleOption* option | Pointer to the node border style option. |
void OH_ArkUI_RenderNodeUtils_SetNodeBorderStyleOptionEdgeStyle(ArkUI_NodeBorderStyleOption* option, ArkUI_BorderStyle edgeStyle, ArkUI_EdgeDirection direction)
Description
Sets the edge style of the node border.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderStyleOption* option | Pointer to the node border style option. |
| ArkUI_BorderStyle edgeStyle | Edge style of the node border. |
| ArkUI_EdgeDirection direction | Edge direction. |
ArkUI_NodeBorderWidthOption* OH_ArkUI_RenderNodeUtils_CreateNodeBorderWidthOption()
Description
Creates a node border width option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeNodeBorderWidthOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_NodeBorderWidthOption* | Pointer to the node border width option. |
void OH_ArkUI_RenderNodeUtils_DisposeNodeBorderWidthOption(ArkUI_NodeBorderWidthOption* option)
Description
Disposes of the node border width option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderWidthOption* option | Pointer to the node border width option. |
void OH_ArkUI_RenderNodeUtils_SetNodeBorderWidthOptionEdgeWidth(ArkUI_NodeBorderWidthOption* option, float edgeWidth, ArkUI_EdgeDirection direction)
Description
Sets the edge width of the node border.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderWidthOption* option | Pointer to the node border width option. |
| float edgeWidth | Edge width of the node border, in px. The value range is [0, +∞). If a negative value is passed, the width of the corresponding edge remains unchanged. |
| ArkUI_EdgeDirection direction | Edge direction. |
ArkUI_NodeBorderColorOption* OH_ArkUI_RenderNodeUtils_CreateNodeBorderColorOption()
Description
Creates a node border color option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeNodeBorderColorOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_NodeBorderColorOption* | Pointer to the node border color option. |
void OH_ArkUI_RenderNodeUtils_DisposeNodeBorderColorOption(ArkUI_NodeBorderColorOption* option)
Description
Disposes of the node border color option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderColorOption* option | Pointer to the node border color option. |
void OH_ArkUI_RenderNodeUtils_SetNodeBorderColorOptionEdgeColor(ArkUI_NodeBorderColorOption* option, uint32_t edgeColor, ArkUI_EdgeDirection direction)
Description
Sets the edge color of the node border.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderColorOption* option | Pointer to the node border color option. |
| uint32_t edgeColor | Edge color of the node border, in 0xAARRGGBB format, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
| ArkUI_EdgeDirection direction | Edge direction. |
ArkUI_NodeBorderRadiusOption* OH_ArkUI_RenderNodeUtils_CreateNodeBorderRadiusOption()
Description
Creates a node border radius option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeNodeBorderRadiusOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_NodeBorderRadiusOption* | Pointer to the node border radius option. |
void OH_ArkUI_RenderNodeUtils_DisposeNodeBorderRadiusOption(ArkUI_NodeBorderRadiusOption* option)
Description
Disposes of the node border radius option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderRadiusOption* option | Pointer to the node border radius option. |
void OH_ArkUI_RenderNodeUtils_SetNodeBorderRadiusOptionCornerRadius(ArkUI_NodeBorderRadiusOption* option, uint32_t cornerRadius, ArkUI_CornerDirection direction)
Description
Sets the border radius of a specified corner of a node.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeBorderRadiusOption* option | Pointer to the node border radius option. |
| uint32_t cornerRadius | Border radius of a specified corner of a node, in px. The value is a non-negative integer. |
| ArkUI_CornerDirection direction | Direction of the target corner. |
ArkUI_CircleShapeOption* OH_ArkUI_RenderNodeUtils_CreateCircleShapeOption()
Description
Creates a circle shape option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeCircleShapeOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_CircleShapeOption* | Pointer to the circle shape option. |
void OH_ArkUI_RenderNodeUtils_DisposeCircleShapeOption(ArkUI_CircleShapeOption* option)
Description
Disposes of the circle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* option | Pointer to the circle shape option. |
void OH_ArkUI_RenderNodeUtils_SetCircleShapeOptionCenterX(ArkUI_CircleShapeOption* option, float centerX)
Description
Sets the X-coordinate of the center for the circle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* option | Pointer to the circle shape option. |
| float centerX | X-coordinate of the center, in px. |
void OH_ArkUI_RenderNodeUtils_SetCircleShapeOptionCenterY(ArkUI_CircleShapeOption* option, float centerY)
Description
Sets the Y-coordinate of the center for the circle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* option | Pointer to the circle shape option. |
| float centerY | Y-coordinate of the center, in px. |
void OH_ArkUI_RenderNodeUtils_SetCircleShapeOptionRadius(ArkUI_CircleShapeOption* option, float radius)
Description
Sets the radius value for the circle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* option | Pointer to the circle shape option. |
| float radius | Radius, in pixels. |
ArkUI_RoundRectShapeOption* OH_ArkUI_RenderNodeUtils_CreateRoundRectShapeOption()
Description
Creates a rounded rectangle shape option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRoundRectShapeOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_RoundRectShapeOption* | Pointer to the rounded rectangle shape option. |
void OH_ArkUI_RenderNodeUtils_DisposeRoundRectShapeOption(ArkUI_RoundRectShapeOption* option)
Description
Disposes of the rounded rectangle shape option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* option | Pointer to the rounded rectangle shape option. |
void OH_ArkUI_RenderNodeUtils_SetRoundRectShapeOptionEdgeValue(ArkUI_RoundRectShapeOption* option, float edgeValue, ArkUI_EdgeDirection direction)
Description
Sets the edge value for the rounded rectangle shape option.
The left or top edge can be a negative value, indicating that the corresponding edge is on the left or above the node origin. When the shape is used for masking, the part that exceeds the node boundary is not displayed. When the shape is used for clipping and the content outside the node boundary needs to be displayed, you need to use OH_ArkUI_RenderNodeUtils_SetDrawRegion to set the drawing area that covers the content.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* option | Pointer to the rounded rectangle shape option. |
| float edgeValue | Edge value of the rounded rectangle shape option, in px. |
| ArkUI_EdgeDirection direction | Edge direction to apply the value. |
void OH_ArkUI_RenderNodeUtils_SetRoundRectShapeOptionCornerXY(ArkUI_RoundRectShapeOption* option, float x, float y, ArkUI_CornerDirection direction)
Description
Sets the corner radius for the X and Y axes of a specified corner.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* option | Pointer to the rounded rectangle shape option. |
| float x | Corner radius of the X axis of the specified corner, in px. |
| float y | Corner radius of the Y axis of the specified corner, in px. |
| ArkUI_CornerDirection direction | Direction of the target corner. |
ArkUI_CommandPathOption* OH_ArkUI_RenderNodeUtils_CreateCommandPathOption()
Description
Creates a custom drawing path option.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeCommandPathOption to release it.
Since: 20
Return value
| Type | Description |
|---|---|
| ArkUI_CommandPathOption* | Pointer to the custom drawing path option. |
void OH_ArkUI_RenderNodeUtils_DisposeCommandPathOption(ArkUI_CommandPathOption* option)
Description
Disposes of the custom drawing path option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CommandPathOption* option | Pointer to the custom drawing path option. |
void OH_ArkUI_RenderNodeUtils_SetCommandPathOptionCommands(ArkUI_CommandPathOption* option, char* commands)
Description
Sets the command values for the custom drawing path option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CommandPathOption* option | Pointer to the custom drawing path option. |
| char* commands | Command values. The input parameter format is the <path> shape label in Basic Shapes of SVG. |
ArkUI_RenderNodeMaskOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeMaskOptionFromRectShape(ArkUI_RectShapeOption* shape)
Description
Creates a mask from a rectangle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* shape | Pointer to the rectangle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* | Pointer to the render node mask. |
ArkUI_RenderNodeMaskOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeMaskOptionFromRoundRectShape(ArkUI_RoundRectShapeOption* shape)
Description
Creates a mask from a rounded rectangle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* shape | Pointer to the rounded rectangle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* | Pointer to the render node mask. |
ArkUI_RenderNodeMaskOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeMaskOptionFromCircleShape(ArkUI_CircleShapeOption* shape)
Description
Creates a mask from a circle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* shape | Pointer to the circle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* | Pointer to the render node mask. |
ArkUI_RenderNodeMaskOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeMaskOptionFromOvalShape(ArkUI_RectShapeOption* shape)
Description
Creates a mask from an oval shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* shape | Pointer to the oval shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* | Pointer to the render node mask. |
ArkUI_RenderNodeMaskOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeMaskOptionFromCommandPath(ArkUI_CommandPathOption* path)
Description
Creates a mask from a custom drawing path.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CommandPathOption* path | Pointer to the custom drawing path option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* | Pointer to the render node mask. |
void OH_ArkUI_RenderNodeUtils_DisposeRenderNodeMaskOption(ArkUI_RenderNodeMaskOption* option)
Description
Disposes of the render node mask option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* option | Pointer to the render node mask. |
void OH_ArkUI_RenderNodeUtils_SetRenderNodeMaskOptionFillColor(ArkUI_RenderNodeMaskOption* mask, uint32_t fillColor)
Description
Sets the fill color for the render node mask option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* mask | Pointer to the render node mask. |
| uint32_t fillColor | Fill color of the mask, in 0xAARRGGBB format, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
void OH_ArkUI_RenderNodeUtils_SetRenderNodeMaskOptionStrokeColor(ArkUI_RenderNodeMaskOption* mask, uint32_t strokeColor)
Description
Sets the stroke color for the render node mask option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* mask | Pointer to the render node mask. |
| uint32_t strokeColor | Stroke color of the mask, in 0xAARRGGBB format, where A, R, G, and B indicate the alpha, red, green, and blue channels, respectively. |
void OH_ArkUI_RenderNodeUtils_SetRenderNodeMaskOptionStrokeWidth(ArkUI_RenderNodeMaskOption* mask, float strokeWidth)
Description
Sets the stroke width for the render node mask option.
Drawing with the corresponding width is performed centered on the border path.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeMaskOption* mask | Pointer to the render node mask. |
| float strokeWidth | Stroke width of the mask, in px. If the value is greater than 0, the stroke is drawn based on the specified width. If the value is 0 or a negative number, the stroke is drawn as a thin line with a width of 1 px on the device. |
ArkUI_RenderNodeClipOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeClipOptionFromRectShape(ArkUI_RectShapeOption* shape)
Description
Creates a render node clip option from a rectangle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* shape | Pointer to the rectangle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeClipOption* | Pointer to the render node clip. |
ArkUI_RenderNodeClipOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeClipOptionFromRoundRectShape(ArkUI_RoundRectShapeOption* shape)
Description
Creates a render node clip option from a rounded rectangle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* shape | Pointer to the rounded rectangle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeClipOption* | Pointer to the render node clip. |
ArkUI_RenderNodeClipOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeClipOptionFromCircleShape(ArkUI_CircleShapeOption* shape)
Description
Creates a render node clip option from a circle shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CircleShapeOption* shape | Pointer to the circle shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeClipOption* | Pointer to the render node clip. |
ArkUI_RenderNodeClipOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeClipOptionFromOvalShape(ArkUI_RectShapeOption* shape)
Description
Creates a render node clip option from an oval shape.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* shape | Pointer to the oval shape option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeClipOption* | Pointer to the render node clip. |
ArkUI_RenderNodeClipOption* OH_ArkUI_RenderNodeUtils_CreateRenderNodeClipOptionFromCommandPath(ArkUI_CommandPathOption* path)
Description
Creates a render node clip option from a custom drawing path.
After using the option, call OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption to release it.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_CommandPathOption* path | Pointer to the custom drawing path option. |
Return value
| Type | Description |
|---|---|
| ArkUI_RenderNodeClipOption* | Pointer to the render node clip. |
void OH_ArkUI_RenderNodeUtils_DisposeRenderNodeClipOption(ArkUI_RenderNodeClipOption* option)
Description
Disposes of the render node clip option.
Since: 20
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeClipOption* option | Pointer to the render node clip. |
int32_t OH_ArkUI_RenderNodeUtils_GetRenderNode(ArkUI_NodeHandle node, ArkUI_RenderNodeHandle* renderNode)
Description
Obtains the RenderNode of the target node that has been accepted as a child node. If a RenderNode is obtained through this API, when the disposeNode API of ArkUI_NativeNodeAPI_1 is invoked to destroy the FrameNode, the OH_ArkUI_RenderNodeUtils_DisposeNode API needs to be invoked additionally to release the RenderNode.
Since: 22
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Pointer to ArkUI_NodeHandle, which specifies the target node. |
| ArkUI_RenderNodeHandle* renderNode | Pointer to ArkUI_RenderNodeHandle, which specifies the RenderNode of the target node. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_RENDER_NOT_ADOPTED_NODE if this node is not accepted as a child node. |
void OH_ArkUI_RenderNodeUtils_SetRectShapeOptionValue(ArkUI_RectShapeOption* option, float x, float y, float width, float height)
Description
Sets the border range for a rectangle shape option.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RectShapeOption* option | Pointer to the rectangle shape option to be configured. |
| float x | X coordinate of the upper left corner of the rectangle, which is used to determine the position of the left boundary. |
| float y | Y coordinate of the upper left corner of the rectangle, which is used to determine the position of the upper boundary. |
| float width | Width of the rectangle, which indicates the horizontal span starting from the X coordinate and is used to determine the position of the right boundary. That is, the X coordinate of the lower right corner of the rectangle is equal to x + width. |
| float height | Height of the rectangle, which indicates the vertical span starting from the Y coordinate and is used to determine the position of the bottom boundary. That is, the Y coordinate of the lower right corner of the rectangle is equal to y + height. |
void OH_ArkUI_RenderNodeUtils_SetRoundRectShapeOptionValue(ArkUI_RoundRectShapeOption* option, float x, float y, float width, float height)
Description
Sets the border range for a rounded rectangle shape option.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RoundRectShapeOption* option | Pointer to the rounded rectangle shape option to be configured. |
| float x | X coordinate of the upper left corner of the rectangle, which is used to determine the position of the left boundary. |
| float y | Y coordinate of the upper left corner of the rectangle, which is used to determine the position of the upper boundary. |
| float width | Width of the rectangle, which indicates the horizontal span starting from the X coordinate and is used to determine the position of the right boundary. That is, the X coordinate of the lower right corner of the rectangle is equal to x + width. |
| float height | Height of the rectangle, which indicates the vertical span starting from the Y coordinate and is used to determine the position of the bottom boundary. That is, the Y coordinate of the lower right corner of the rectangle is equal to y + height. |
ArkUI_RenderBlurStyleOption* OH_ArkUI_RenderNodeUtils_CreateBlurStyleOption()
Description
Creates a blur style object.
After using the object, call OH_ArkUI_RenderNodeUtils_DisposeBlurStyleOption to destroy it and release resources.
Since: 26.0.0
Return value
| Type | Description |
|---|---|
| ArkUI_RenderBlurStyleOption* | Pointer to a blur style object. The default blur radius is 0.0. |
void OH_ArkUI_RenderNodeUtils_DisposeBlurStyleOption(ArkUI_RenderBlurStyleOption* option)
Description
Dispose of a blur style object.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderBlurStyleOption* option | ArkUI_RenderBlurStyleOption pointer to the blur style object to be disposed of. |
int32_t OH_ArkUI_RenderNodeUtils_SetBlurStyleOptionRadius(ArkUI_RenderBlurStyleOption* option, float radius)
Description
Sets a blur radius for a target blur style.
The blur radius is used to control the blur density. A larger radius indicates a higher blur density. If the radius is set to 0, no blur processing is performed. For background blur, a radius of 80 px can achieve a good frosted glass effect. Avoid using a blur radius greater than 200 px, as this may cause performance degradation.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderBlurStyleOption* option | ArkUI_RenderBlurStyleOption pointer to the target blur style for which the blur radius is to be set. |
| float radius | Blur radius to be set. The value range is [0, +∞). Unit: px. If a negative value is passed, ARKUI_ERROR_CODE_PARAM_INVALID is returned. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
int32_t OH_ArkUI_RenderNodeUtils_SetBackgroundBlurOption(ArkUI_RenderNodeHandle node, ArkUI_RenderBlurStyleOption* option)
Description
Sets a background blur style for a render node. This API is applicable to scenarios where the background content of the node needs to be blurred.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the background blur style is to be set. |
| ArkUI_RenderBlurStyleOption* option | ArkUI_RenderBlurStyleOption pointer to the blur style to be set. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_ResetBackgroundBlurOption(ArkUI_RenderNodeHandle node)
Description
Resets a background blur style for a render node.
After the reset, there is no background blur style.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the background blur style is to be reset. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_SetForegroundBlurOption(ArkUI_RenderNodeHandle node, ArkUI_RenderBlurStyleOption* option)
Description
Sets a foreground blur style for a render node. This API is applicable to scenarios where the foreground image layer of the node needs to be blurred.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the foreground blur style is to be set. |
| ArkUI_RenderBlurStyleOption* option | ArkUI_RenderBlurStyleOption pointer to the blur style to be set. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_ResetForegroundBlurOption(ArkUI_RenderNodeHandle node)
Description
Resets a foreground blur style for a render node.
After the reset, there is no foreground blur style.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the foreground blur style is to be reset. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_SetContentBlurOption(ArkUI_RenderNodeHandle node, ArkUI_RenderBlurStyleOption* option)
Description
Sets a content blur style for a render node. This API is applicable to scenarios where the content drawn by the node needs to be blurred.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the content blur style is to be set. |
| ArkUI_RenderBlurStyleOption* option | ArkUI_RenderBlurStyleOption pointer to the blur style to be set. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
int32_t OH_ArkUI_RenderNodeUtils_ResetContentBlurOption(ArkUI_RenderNodeHandle node)
Description
Resets a content blur style for a render node.
After the reset, there is no content blur style.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_RenderNodeHandle node | ArkUI_RenderNodeHandle pointer to the target render node for which the content blur style is to be reset. |
Return value
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_RENDER_IS_FROM_FRAME_NODE if the target node originates from a FrameNode. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
ArkUI_ErrorCode OH_ArkUI_RenderNodeUtils_InsertRenderNodeAt(ArkUI_NodeHandle node, ArkUI_RenderNodeHandle child, int32_t position)
Description
Inserts a child render node at a specified position under a parent custom node.
By default, the OH_ARKUI_NODE_MOUNT_POLICY_SINGLE_IF_RENDER_NODE mount policy is used. The child render node to be inserted must be the only child node of the parent element. You can use OH_ArkUI_NativeModule_SetChildMountPolicy to set the mount policy to OH_ARKUI_NODE_MOUNT_POLICY_MIXED to mount multiple child nodes.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target parent node. Only the ARKUI_NODE_CUSTOM type in ArkUI_NodeType is supported. |
| ArkUI_RenderNodeHandle child | Child render node to be inserted. |
| int32_t position | Index of the child render node to be inserted. The value range is [0, Number of current child nodes]. If the value is equal to the number of current child nodes, the operation is equivalent to adding a child render node. |
Return value
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. Returns ARKUI_ERROR_CODE_NOT_CUSTOM_NODE if the target node is not a custom node. Returns ARKUI_ERROR_CODE_CHILD_EXISTED if the parent node already has a child node when a non-OH_ARKUI_NODE_MOUNT_POLICY_MIXED mount policy is used. Returns ARKUI_ERROR_CODE_RENDER_PARENT_EXISTED if the target render node has a parent node. Returns ARKUI_ERROR_CODE_RENDER_HAS_INVALID_FRAME_NODE if the current render node originates from a FrameNode that has been either detached as a child node or destroyed. |
ArkUI_ErrorCode OH_ArkUI_RenderNodeUtils_GetRenderNodeChildrenCount(ArkUI_NodeHandle node, int32_t* count)
Description
Obtains the number of all child nodes of a parent custom node in the mixed mount order.
The count includes both common nodes and render nodes. The parent node must be of the ARKUI_NODE_CUSTOM type and the OH_ARKUI_NODE_MOUNT_POLICY_MIXED policy must have been set using OH_ArkUI_NativeModule_SetChildMountPolicy. Otherwise, ARKUI_ERROR_CODE_PARAM_INVALID is returned.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Parent node to be queried. |
| int32_t* count | Pointer used to receive the number of child nodes. |
Return value
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |
ArkUI_ErrorCode OH_ArkUI_RenderNodeUtils_GetRenderNodeAt(ArkUI_NodeHandle node, int32_t position, ArkUI_RenderNodeHandle* child)
Description
Obtains the render node handle corresponding to the child node at a specified position of a parent custom node in the mixed mount order.
The parent node must be of the ARKUI_NODE_CUSTOM type and the OH_ARKUI_NODE_MOUNT_POLICY_MIXED policy must have been set using OH_ArkUI_NativeModule_SetChildMountPolicy. Otherwise, ARKUI_ERROR_CODE_PARAM_INVALID is returned.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | Target parent node. |
| int32_t position | Index of a child node. The value range is [0, Number of current child nodes – 1]. |
| ArkUI_RenderNodeHandle* child | Pointer used to receive the render node handle corresponding to the child node at the specified position. The value cannot be null. |
Return value
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_CAPI_INIT_ERROR if C API initialization failed. |