drawing_shadow_layer.h
Overview
This file declares the functions related to the shadow in the drawing module.
File to include: <native_drawing/drawing_shadow_layer.h>
Library: libnative_drawing.so
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Related module: Drawing
Summary
Functions
| Name | Description |
|---|---|
| OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate(float blurRadius, float x, float y, uint32_t color) | Creates an OH_Drawing_ShadowLayer object. This API may return an error code. For details, call OH_Drawing_ErrorCodeGet. If blurRadius is less than or equal to 0, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned. |
| void OH_Drawing_ShadowLayerDestroy(OH_Drawing_ShadowLayer* shadowLayer) | Destroys an OH_Drawing_ShadowLayer object and reclaims the memory occupied by the object. |
Function Description
OH_Drawing_ShadowLayerCreate()
OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate(float blurRadius, float x, float y, uint32_t color)
Description
Creates an OH_Drawing_ShadowLayer object.
This API may return an error code. For details, call OH_Drawing_ErrorCodeGet.
If blurRadius is less than or equal to 0, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| float blurRadius | Radius of the shadow layer. The value must be greater than 0. |
| float x | Offset on the X axis. |
| float y | Offset on the Y axis. |
| uint32_t color | Color of the shadow. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_ShadowLayer* | Returns the pointer to the OH_Drawing_ShadowLayer object created. |
OH_Drawing_ShadowLayerDestroy()
void OH_Drawing_ShadowLayerDestroy(OH_Drawing_ShadowLayer* shadowLayer)
Description
Destroys an OH_Drawing_ShadowLayer object and reclaims the memory occupied by the object.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_Drawing_ShadowLayer* shadowLayer | Pointer to the shadow layer. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-drawing-gpu-context-h
openharmony 鸿蒙 capi-drawing-nativepixelmap-
openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange
openharmony 鸿蒙 capi-drawing-oh-drawing-brush
openharmony 鸿蒙 capi-drawing-oh-drawing-image-info
openharmony 鸿蒙 capi-drawing-text-linetypography-h
openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage
openharmony 鸿蒙 capi-drawing-typeface-h