drawing_memory_stream.h
Overview
This file declares the functions related to the memory stream in the drawing module.
File to include: <native_drawing/drawing_memory_stream.h>
Library: libnative_drawing.so
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Related module: Drawing
Summary
Functions
| Name | Description |
|---|---|
| OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate(const void* data, size_t length, bool copyData) | Creates an OH_Drawing_MemoryStream object. This API may return an error code. For details, call OH_Drawing_ErrorCodeGet. If data is NULL or length is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. |
| void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream* memoryStream) | Destroys an OH_Drawing_MemoryStream object and reclaims the memory occupied by the object. |
Function Description
OH_Drawing_MemoryStreamCreate()
OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate(const void* data, size_t length, bool copyData)
Description
Creates an OH_Drawing_MemoryStream object.
This API may return an error code. For details, call OH_Drawing_ErrorCodeGet.
If data is NULL or length is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| const void* data | Pointer to the data. |
| size_t length | Length of the data. |
| bool copyData | Whether to copy data. The value true means that the OH_Drawing_MemoryStream object copies the data, and false means that the OH_Drawing_MemoryStream object directly uses the data without copying. |
Returns
| Type | Description |
|---|---|
| OH_Drawing_MemoryStream* | Returns the pointer to the OH_Drawing_MemoryStream object created. |
OH_Drawing_MemoryStreamDestroy()
void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream* memoryStream)
Description
Destroys an OH_Drawing_MemoryStream object and reclaims the memory occupied by the object.
System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_Drawing_MemoryStream* memoryStream | Pointer to an OH_Drawing_MemoryStream object. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-drawing-gpu-context-h
openharmony 鸿蒙 capi-drawing-nativepixelmap-
openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange
openharmony 鸿蒙 capi-drawing-oh-drawing-brush
openharmony 鸿蒙 capi-drawing-oh-drawing-image-info
openharmony 鸿蒙 capi-drawing-text-linetypography-h
openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage
openharmony 鸿蒙 capi-drawing-typeface-h