openharmony 鸿蒙 capi-drawing-memory-stream-h

2026-08-25 浏览 (1)

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

NameDescription
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

NameDescription
const void* dataPointer to the data.
size_t lengthLength of the data.
bool copyDataWhether 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

TypeDescription
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

NameDescription
OH_Drawing_MemoryStream* memoryStreamPointer 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

openharmony 鸿蒙 capi-drawing-brush-h

openharmony 鸿蒙 capi-nativewindow

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