openharmony 鸿蒙 capi-drawing-point-h

2026-08-25 浏览 (1)

drawing_point.h

Overview

This file declares the functions related to the coordinate point in the drawing module.

File to include: <native_drawing/drawing_point.h>

Library: libnative_drawing.so

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 11

Related module: Drawing

Summary

Functions

NameDescription
OH_Drawing_Point* OH_Drawing_PointCreate(float x, float y)Creates an OH_Drawing_Point object.
OH_Drawing_ErrorCode OH_Drawing_PointGetX(const OH_Drawing_Point* point, float* x)Obtains the X coordinate of a point.
OH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float* y)Obtains the Y coordinate of a point.
OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y)Sets the X and Y coordinates of a point.
void OH_Drawing_PointDestroy(OH_Drawing_Point* point)Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object.

Function Description

OH_Drawing_PointCreate()

OH_Drawing_Point* OH_Drawing_PointCreate(float x, float y)

Description

Creates an OH_Drawing_Point object.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 11

Parameters

NameDescription
float xX coordinate of the point.
float yY coordinate of the point.

Returns

TypeDescription
OH_Drawing_Point*Returns the pointer to the OH_Drawing_Point object created.

OH_Drawing_PointGetX()

OH_Drawing_ErrorCode OH_Drawing_PointGetX(const OH_Drawing_Point* point, float* x)

Description

Obtains the X coordinate of a point.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Parameters

NameDescription
const OH_Drawing_Point* pointPointer to an OH_Drawing_Point object.
float* xPointer to the X coordinate.

Returns

TypeDescription
OH_Drawing_ErrorCodeReturns one of the following result codes:
OH_DRAWING_SUCCESS if the operation is successful.
OH_DRAWING_ERROR_INVALID_PARAMETER if either point or x is NULL.

OH_Drawing_PointGetY()

OH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float* y)

Description

Obtains the Y coordinate of a point.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Parameters

NameDescription
const OH_Drawing_Point* pointPointer to an OH_Drawing_Point object.
float* yPointer to the Y coordinate.

Returns

TypeDescription
OH_Drawing_ErrorCodeReturns one of the following result codes:
OH_DRAWING_SUCCESS if the operation is successful.
OH_DRAWING_ERROR_INVALID_PARAMETER if either point or y is NULL.

OH_Drawing_PointSet()

OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y)

Description

Sets the X and Y coordinates of a point.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Parameters

NameDescription
OH_Drawing_Point* pointPointer to an OH_Drawing_Point object.
float xPointer to the X coordinate.
float yPointer to the Y coordinate.

Returns

TypeDescription
OH_Drawing_ErrorCodeReturns one of the following result codes:
OH_DRAWING_SUCCESS if the operation is successful.
OH_DRAWING_ERROR_INVALID_PARAMETER if point is NULL.

OH_Drawing_PointDestroy()

void OH_Drawing_PointDestroy(OH_Drawing_Point* point)

Description

Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 11

Parameters

NameDescription
OH_Drawing_Point* pointPointer to an OH_Drawing_Point 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/VvmDwuZ8