openharmony 鸿蒙 capi-drawing-shadow-layer-h

2026-08-25 浏览 (1)

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

NameDescription
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

NameDescription
float blurRadiusRadius of the shadow layer. The value must be greater than 0.
float xOffset on the X axis.
float yOffset on the Y axis.
uint32_t colorColor of the shadow.

Returns

TypeDescription
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

NameDescription
OH_Drawing_ShadowLayer* shadowLayerPointer 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

openharmony 鸿蒙 capi-drawing-brush-h

openharmony 鸿蒙 capi-nativewindow

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/7zT1k9cO