openharmony 鸿蒙 capi-drawing-error-code-h

2026-08-25 浏览 (1)

drawing_error_code.h

Overview

This file declares the functions related to the error code in the drawing module.

File to include: <native_drawing/drawing_error_code.h>

Library: libnative_drawing.so

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Related module: Drawing

Summary

Enumerated value

Nametypedef KeywordDescription
OH_Drawing_ErrorCodeOH_Drawing_ErrorCodeDefines an enum for the error codes that may be generated by the module.

Functions

NameDescription
OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet()Obtains the error code of the module.
void OH_Drawing_ErrorCodeReset(void)Resets the error code of this module to OH_DRAWING_SUCCESS.
When a function that does not return an error code fails, the error code obtained through OH_Drawing_ErrorCodeGet is reset to the corresponding error number. However, it is not reset to OH_DRAWING_SUCCESS for a successful operation.
By calling this function, you can manually reset the error code to OH_DRAWING_SUCCESS, avoiding interference between different functions and simplifying the debugging process.

Enum Description

OH_Drawing_ErrorCode

enum OH_Drawing_ErrorCode

Description

Defines an enum for the error codes that may be generated by the module.

Since: 12

ValueDescription
OH_DRAWING_SUCCESS = 0Operation successful.
OH_DRAWING_ERROR_NO_PERMISSION = 201Permission denied.
OH_DRAWING_ERROR_INVALID_PARAMETER = 401Invalid input parameter. For example, NULL is passed in.
OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001The input parameter is not in the valid range.
OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002Failed to allocate memory.
Since: 13
OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH = 26200003No function matches the input attribute ID.
Since: 21
OH_DRAWING_ERROR_INCORRECT_PARAMETER = 26200004The input parameter is incorrect. For example, the pointer of the input parameter is null.
Since: 22
OH_DRAWING_ERROR_FILE_NOT_FOUND = 26200005File not found. The specified file does not exist or the path is incorrect.
Since: 23
OH_DRAWING_ERROR_OPEN_FILE_FAILED = 26200006Failed to open the file, which is caused by insufficient permissions or I/O issues.
Since: 23
OH_DRAWING_ERROR_FILE_SEEK_FAILED = 26200007Fails to seek the file. The system cannot reposition the file read pointer.
Since: 23
OH_DRAWING_ERROR_GET_FILE_SIZE_FAILED = 26200008Failed to obtain the file size. The system cannot obtain the file size information.
Since: 23
OH_DRAWING_ERROR_READ_FILE_FAILED = 26200009Failed to read the file. The file cannot be read completely or contains unreadable data.
Since: 23
OH_DRAWING_ERROR_EMPTY_FILE = 26200010Empty file. The specified font file is empty and does not contain valid data.
Since: 23
OH_DRAWING_ERROR_FILE_CORRUPTED = 26200011Corrupted file. The file content is invalid or corrupted, and cannot be parsed.
Since: 23

Function Description

OH_Drawing_ErrorCodeGet()

OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet()

Description

Obtains the error code of the module.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Return value

TypeDescription
OH_Drawing_ErrorCodeObtains the latest error code of the module. After the function is successfully executed, the error code returned by this function will not be modified.

OH_Drawing_ErrorCodeReset()

void OH_Drawing_ErrorCodeReset(void)

Description

Resets the error code of this module to OH_DRAWING_SUCCESS.
When a function that does not return an error code fails, the error code obtained through OH_Drawing_ErrorCodeGet is reset to the corresponding error number. However, it is not reset to OH_DRAWING_SUCCESS for a successful operation.
By calling this function, you can manually reset the error code to OH_DRAWING_SUCCESS, avoiding interference between different functions and simplifying the debugging process.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 18

你可能感兴趣的鸿蒙文章

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/T25lpmd6