We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesGraphicsArkGraphics 2DC APIsHeader Filesdrawing_error_code.h

drawing_error_code.h

Phone12+PC/2in113+Tablet12+TV19+Wearable18+

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

Expand
Name typedef Keyword Description
OH_Drawing_ErrorCode OH_Drawing_ErrorCode Defines an enum for the error codes that may be generated by the module.

Functions

Expand
Name Description
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

Phone12+PC/2in113+Tablet12+TV19+Wearable18+
enum OH_Drawing_ErrorCode

Description

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

Since: 12

Expand
Value Description
OH_DRAWING_SUCCESS = 0 Operation successful.
OH_DRAWING_ERROR_NO_PERMISSION = 201 Permission denied.
OH_DRAWING_ERROR_INVALID_PARAMETER = 401 Invalid input parameter. For example, NULL is passed in.
OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001 The input parameter is not in the valid range.
OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002

Failed to allocate memory.

Since: 13

OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH = 26200003

No function matches the input attribute ID.

Since: 21

OH_DRAWING_ERROR_INCORRECT_PARAMETER = 26200004

The input parameter is incorrect. For example, the pointer of the input parameter is null.

Since: 22

OH_DRAWING_ERROR_FILE_NOT_FOUND = 26200005

File not found. The specified file does not exist or the path is incorrect.

Since: 23

OH_DRAWING_ERROR_OPEN_FILE_FAILED = 26200006

Failed to open the file, which is caused by insufficient permissions or I/O issues.

Since: 23

OH_DRAWING_ERROR_FILE_SEEK_FAILED = 26200007

Fails to seek the file. The system cannot reposition the file read pointer.

Since: 23

OH_DRAWING_ERROR_GET_FILE_SIZE_FAILED = 26200008

Failed to obtain the file size. The system cannot obtain the file size information.

Since: 23

OH_DRAWING_ERROR_READ_FILE_FAILED = 26200009

Failed to read the file. The file cannot be read completely or contains unreadable data.

Since: 23

OH_DRAWING_ERROR_EMPTY_FILE = 26200010

Empty file. The specified font file is empty and does not contain valid data.

Since: 23

OH_DRAWING_ERROR_FILE_CORRUPTED = 26200011

Corrupted file. The file content is invalid or corrupted, and cannot be parsed.

Since: 23

Function Description

OH_Drawing_ErrorCodeGet()

Phone12+PC/2in113+Tablet12+TV19+Wearable18+
OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet()

Description

Obtains the error code of the module.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Return value

Expand
Type Description
OH_Drawing_ErrorCode Obtains 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()

Phone18+PC/2in118+Tablet18+TV19+Wearable18+
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

Search in References
Enter a keyword.