未验证 提交 01bfc477 编写于 作者: O openharmony_ci 提交者: Gitee

!9743 native api更新,不涉及翻译

Merge pull request !9743 from zengyawen/forNative
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
- 模块 - 模块
- [Native XComponent](_o_h___native_x_component.md) - [Native XComponent](_o_h___native_x_component.md)
- [Native_Bundle](_native___bundle.md)
- [HiLog](_hi_log.md) - [HiLog](_hi_log.md)
- [NativeWindow](_native_window.md) - [NativeWindow](_native_window.md)
- [OH_NativeBuffer](_o_h___native_buffer.md)
- [Drawing](_drawing.md) - [Drawing](_drawing.md)
- [OH_NativeImage](_o_h___native_image.md)
- [NativeVsync](_native_vsync.md)
- [Image](image.md)
- [Rawfile](rawfile.md) - [Rawfile](rawfile.md)
- 头文件 - 头文件
- [drawing_bitmap.h](drawing__bitmap_8h.md) - [drawing_bitmap.h](drawing__bitmap_8h.md)
- [drawing_brush.h](drawing__brush_8h.md) - [drawing_brush.h](drawing__brush_8h.md)
- [drawing_canvas.h](drawing__canvas_8h.md) - [drawing_canvas.h](drawing__canvas_8h.md)
...@@ -20,14 +22,22 @@ ...@@ -20,14 +22,22 @@
- [drawing_text_typography.h](drawing__text__typography_8h.md) - [drawing_text_typography.h](drawing__text__typography_8h.md)
- [drawing_types.h](drawing__types_8h.md) - [drawing_types.h](drawing__types_8h.md)
- [external_window.h](external__window_8h.md) - [external_window.h](external__window_8h.md)
- [image_pixel_map_napi.h](image__pixel__map__napi_8h.md)
- [log.h](log_8h.md) - [log.h](log_8h.md)
- [native_interface_bundle.h](native__interface__bundle_8h.md) - [native_buffer.h](native__buffer_8h.md)
- [native_image.h](native__image_8h.md)
- [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) - [native_interface_xcomponent.h](native__interface__xcomponent_8h.md)
- [native_vsync.h](native__vsync_8h.md)
- [raw_dir.h](raw__dir_8h.md) - [raw_dir.h](raw__dir_8h.md)
- [raw_file_manager.h](raw__file__manager_8h.md)
- [raw_file.h](raw__file_8h.md) - [raw_file.h](raw__file_8h.md)
- 结构体 - 结构体
- [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) - [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md)
- [OH_NativeBuffer_Config](_o_h___native_buffer___config.md)
- [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) - [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)
- [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md)
- [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md)
- [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) - [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md)
- [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) - [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md)
- [OhosPixelMapInfo](_ohos_pixel_map_info.md)
- [RawFileDescriptor](_raw_file_descriptor.md) - [RawFileDescriptor](_raw_file_descriptor.md)
# Drawing # Drawing
## **Overview** Drawing模块提供包括2D图形渲染、文字绘制和图片显示等功能函数。
**Description:**
Drawing模块提供包括2D图形渲染、文字绘制和图片显示等功能函数 提供2D绘制功能。
Drawing模块提供包括2D图形渲染、文字绘制和图片显示等功能函数.
提供2D绘制功能 @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Since:** **自从:**
8
**Version:**
1.0
## **Summary**
8
### Files
| File Name | Description | ## 汇总
| -------- | -------- |
| [drawing_bitmap.h](drawing__bitmap_8h.md) | 文件中定义了与位图相关的功能函数 |
| [drawing_brush.h](drawing__brush_8h.md) | 文件中定义了与画刷相关的功能函数 | ### 文件
| [drawing_canvas.h](drawing__canvas_8h.md) | 文件中定义了与画布相关的功能函数 |
| [drawing_color.h](drawing__color_8h.md) | 文件中定义了与颜色相关的功能函数 | | 文件名称 | 描述 |
| [drawing_font_collection.h](drawing__font__collection_8h.md) | 定义绘制模块中与fontCollection相关的函数 | | -------- | -------- |
| [drawing_path.h](drawing__path_8h.md) | 文件中定义了与自定义路径相关的功能函数 | | [drawing_bitmap.h](drawing__bitmap_8h.md) | 文件中定义了与位图相关的功能函数。 |
| [drawing_pen.h](drawing__pen_8h.md) | 文件中定义了与画笔相关的功能函数 | | [drawing_brush.h](drawing__brush_8h.md) | 文件中定义了与画刷相关的功能函数。 |
| [drawing_text_declaration.h](drawing__text__declaration_8h.md) | 提供2d drawing文本相关的数据结构声明 | | [drawing_canvas.h](drawing__canvas_8h.md) | 文件中定义了与画布相关的功能函数。 |
| [drawing_text_typography.h](drawing__text__typography_8h.md) | 定义绘制模块中排版相关的函数 | | [drawing_color.h](drawing__color_8h.md) | 文件中定义了与颜色相关的功能函数。 |
| [drawing_types.h](drawing__types_8h.md) | 文件中定义了用于绘制2d图形的数据类型,包括画布、画笔、画刷、位图和路径 | | [drawing_font_collection.h](drawing__font__collection_8h.md) | 定义绘制模块中与fontCollection相关的函数。 |
| [drawing_path.h](drawing__path_8h.md) | 文件中定义了与自定义路径相关的功能函数。 |
| [drawing_pen.h](drawing__pen_8h.md) | 文件中定义了与画笔相关的功能函数。 |
### Classes | [drawing_text_declaration.h](drawing__text__declaration_8h.md) | 提供2d drawing文本相关的数据结构声明。 |
| [drawing_text_typography.h](drawing__text__typography_8h.md) | 定义绘制模块中排版相关的函数。 |
| Classes Name | Description | | [drawing_types.h](drawing__types_8h.md) | 文件中定义了用于绘制2d图形的数据类型,包括画布、画笔、画刷、位图和路径。 |
| -------- | -------- |
| [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 结构体用于描述位图像素的格式,包括颜色类型和透明度类型 |
### 结构体
### Typedefs | 结构体名称 | 描述 |
| -------- | -------- |
| Typedef Name | Description | | [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 结构体用于描述位图像素的格式,包括颜色类型和透明度类型。 |
| -------- | -------- |
| OH_Drawing_FontCollection | typedef&nbsp;struct&nbsp;OH_Drawing_FontCollection<br/>OH_Drawing_FontCollection用于加载字体 |
| OH_Drawing_Typography | typedef&nbsp;struct&nbsp;OH_Drawing_Typography<br/>OH_Drawing_Typography用于管理排版的布局和显示等 | ### 类型定义
| OH_Drawing_TextStyle | typedef&nbsp;struct&nbsp;OH_Drawing_TextStyle<br/>OH_Drawing_TextStyle用于管理字体颜色、装饰等 |
| OH_Drawing_TypographyStyle | typedef&nbsp;struct&nbsp;OH_Drawing_TypographyStyle<br/>OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等 | | 类型定义名称 | 描述 |
| OH_Drawing_TypographyCreate | typedef&nbsp;struct&nbsp;OH_Drawing_TypographyCreate<br/>OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography. | | -------- | -------- |
| OH_Drawing_Canvas | typedef&nbsp;struct&nbsp;OH_Drawing_Canvas<br/>OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字 | | [OH_Drawing_FontCollection](#oh_drawing_fontcollection) | OH_Drawing_FontCollection用于加载字体。 |
| OH_Drawing_Pen | typedef&nbsp;struct&nbsp;OH_Drawing_Pen<br/>OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色 | | [OH_Drawing_Typography](#oh_drawing_typography) | OH_Drawing_Typography用于管理排版的布局和显示等。 |
| OH_Drawing_Brush | typedef&nbsp;struct&nbsp;OH_Drawing_Brush<br/>OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色 | | [OH_Drawing_TextStyle](#oh_drawing_textstyle) | OH_Drawing_TextStyle用于管理字体颜色、装饰等。 |
| OH_Drawing_Path | typedef&nbsp;struct&nbsp;OH_Drawing_Path<br/>OH_Drawing_Path定义为路径,路径用于自定义各种形状 | | [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) | OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等。 |
| OH_Drawing_Bitmap | typedef&nbsp;struct&nbsp;OH_Drawing_Bitmap<br/>OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据 | | [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) | OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography。 |
| [OH_Drawing_Canvas](#oh_drawing_canvas) | OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字。 |
| [OH_Drawing_Pen](#oh_drawing_pen) | OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色。 |
### Enumerations | [OH_Drawing_Brush](#oh_drawing_brush) | OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色。 |
| [OH_Drawing_Path](#oh_drawing_path) | OH_Drawing_Path定义为路径,路径用于自定义各种形状。 |
| Enumeration&nbsp;Name | Description | | [OH_Drawing_Bitmap](#oh_drawing_bitmap) | OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据。 |
| -------- | -------- |
| OH_Drawing_PenLineCapStyle&nbsp;{&nbsp;LINE_FLAT_CAP,&nbsp;LINE_SQUARE_CAP,&nbsp;LINE_ROUND_CAP&nbsp;} | 枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式 |
| OH_Drawing_PenLineJoinStyle&nbsp;{&nbsp;LINE_MITER_JOIN,&nbsp;LINE_ROUND_JOIN,&nbsp;LINE_BEVEL_JOIN&nbsp;} | 枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式 | ### 枚举
| OH_Drawing_TextDirection&nbsp;{&nbsp;TEXT_DIRECTION_RTL,&nbsp;TEXT_DIRECTION_LTR&nbsp;} | 文字方向 |
| OH_Drawing_TextAlign&nbsp;{&nbsp;&nbsp;&nbsp;TEXT_ALIGN_LEFT,&nbsp;TEXT_ALIGN_RIGHT,&nbsp;TEXT_ALIGN_CENTER,&nbsp;TEXT_ALIGN_JUSTIFY,&nbsp;&nbsp;&nbsp;TEXT_ALIGN_START,&nbsp;TEXT_ALIGN_END&nbsp;} | 文字对齐方式 | | 枚举名称 | 描述 |
| OH_Drawing_FontWeight&nbsp;{&nbsp;&nbsp;&nbsp;FONT_WEIGHT_100,&nbsp;FONT_WEIGHT_200,&nbsp;FONT_WEIGHT_300,&nbsp;FONT_WEIGHT_400,&nbsp;&nbsp;&nbsp;FONT_WEIGHT_500,&nbsp;FONT_WEIGHT_600,&nbsp;FONT_WEIGHT_700,&nbsp;FONT_WEIGHT_800,&nbsp;&nbsp;&nbsp;FONT_WEIGHT_900&nbsp;} | 字重 | | -------- | -------- |
| OH_Drawing_TextBaseline&nbsp;{&nbsp;TEXT_BASELINE_ALPHABETIC,&nbsp;TEXT_BASELINE_IDEOGRAPHIC&nbsp;} | 基线位置 | | [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) { LINE_FLAT_CAP, LINE_SQUARE_CAP, LINE_ROUND_CAP } | 枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式。 |
| OH_Drawing_TextDecoration&nbsp;{&nbsp;TEXT_DECORATION_NONE&nbsp;=&nbsp;0x0,&nbsp;TEXT_DECORATION_UNDERLINE&nbsp;=&nbsp;0x1,&nbsp;TEXT_DECORATION_OVERLINE&nbsp;=&nbsp;0x2,&nbsp;TEXT_DECORATION_LINE_THROUGH&nbsp;=&nbsp;0x4&nbsp;} | 文本装饰 | | [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) { LINE_MITER_JOIN, LINE_ROUND_JOIN, LINE_BEVEL_JOIN } | 枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式。 |
| OH_Drawing_FontStyle&nbsp;{&nbsp;FONT_STYLE_NORMAL,&nbsp;FONT_STYLE_ITALIC&nbsp;} | 区分字体是否为斜体 | | [OH_Drawing_TextDirection](#oh_drawing_textdirection) { TEXT_DIRECTION_RTL, TEXT_DIRECTION_LTR } | 文字方向。 |
| OH_Drawing_ColorFormat&nbsp;{&nbsp;&nbsp;&nbsp;COLOR_FORMAT_UNKNOWN,&nbsp;COLOR_FORMAT_ALPHA_8,&nbsp;COLOR_FORMAT_RGB_565,&nbsp;COLOR_FORMAT_ARGB_4444,&nbsp;&nbsp;&nbsp;COLOR_FORMAT_RGBA_8888,&nbsp;COLOR_FORMAT_BGRA_8888&nbsp;} | OH_Drawing_ColorFormat用于描述位图像素的存储格式 | | [OH_Drawing_TextAlign](#oh_drawing_textalign) { TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_JUSTIFY, TEXT_ALIGN_START, TEXT_ALIGN_END } | 文字对齐方式。 |
| OH_Drawing_AlphaFormat&nbsp;{&nbsp;ALPHA_FORMAT_UNKNOWN,&nbsp;ALPHA_FORMAT_OPAQUE,&nbsp;ALPHA_FORMAT_PREMUL,&nbsp;ALPHA_FORMAT_UNPREMUL&nbsp;} | OH_Drawing_AlphaFormat用于描述位图像素的透明度分量 | | [OH_Drawing_FontWeight](#oh_drawing_fontweight) { FONT_WEIGHT_100, FONT_WEIGHT_200, FONT_WEIGHT_300, FONT_WEIGHT_400, FONT_WEIGHT_500, FONT_WEIGHT_600, FONT_WEIGHT_700, FONT_WEIGHT_800, FONT_WEIGHT_900 } | 字重。 |
| [OH_Drawing_TextBaseline](#oh_drawing_textbaseline) { TEXT_BASELINE_ALPHABETIC, TEXT_BASELINE_IDEOGRAPHIC } | 基线位置。 |
| [OH_Drawing_TextDecoration](#oh_drawing_textdecoration) { TEXT_DECORATION_NONE = 0x0, TEXT_DECORATION_UNDERLINE = 0x1, TEXT_DECORATION_OVERLINE = 0x2, TEXT_DECORATION_LINE_THROUGH = 0x4 } | 文本装饰。 |
### Functions | [OH_Drawing_FontStyle](#oh_drawing_fontstyle) { FONT_STYLE_NORMAL, FONT_STYLE_ITALIC } | 区分字体是否为斜体。 |
| [OH_Drawing_ColorFormat](#oh_drawing_colorformat) { COLOR_FORMAT_UNKNOWN, COLOR_FORMAT_ALPHA_8, COLOR_FORMAT_RGB_565, COLOR_FORMAT_ARGB_4444, COLOR_FORMAT_RGBA_8888, COLOR_FORMAT_BGRA_8888 } | OH_Drawing_ColorFormat用于描述位图像素的存储格式。 |
| Function | Description | | [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) { ALPHA_FORMAT_UNKNOWN, ALPHA_FORMAT_OPAQUE, ALPHA_FORMAT_PREMUL, ALPHA_FORMAT_UNPREMUL } | OH_Drawing_AlphaFormat用于描述位图像素的透明度分量。 |
| -------- | -------- |
| OH_Drawing_BitmapCreate&nbsp;(void) | OH_Drawing_Bitmap&nbsp;\*<br/>函数用于创建一个位图对象。 |
| OH_Drawing_BitmapDestroy&nbsp;(OH_Drawing_Bitmap&nbsp;\*) | void<br/>函数用于销毁位图对象并回收该对象占有内存。 | ### 函数
| OH_Drawing_BitmapBuild&nbsp;(OH_Drawing_Bitmap&nbsp;\*,&nbsp;const&nbsp;uint32_t&nbsp;width,&nbsp;const&nbsp;uint32_t&nbsp;height,&nbsp;const&nbsp;OH_Drawing_BitmapFormat&nbsp;\*) | void<br/>函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式 |
| OH_Drawing_BitmapGetWidth&nbsp;(OH_Drawing_Bitmap&nbsp;\*) | uint32_t<br/>该函数用于获取指定位图的宽度 | | 函数名称 | 描述 |
| OH_Drawing_BitmapGetHeight&nbsp;(OH_Drawing_Bitmap&nbsp;\*) | uint32_t<br/>函数用于获取指定位图的高度 | | -------- | -------- |
| OH_Drawing_BitmapGetPixels&nbsp;(OH_Drawing_Bitmap&nbsp;\*) | void&nbsp;\*<br/>函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据 | | [OH_Drawing_BitmapCreate](#oh_drawing_bitmapcreate) (void) | 函数用于创建一个位图对象。 |
| OH_Drawing_BrushCreate&nbsp;(void) | OH_Drawing_Brush&nbsp;\*<br/>函数用于创建一个画刷对象 | | [OH_Drawing_BitmapDestroy](#oh_drawing_bitmapdestroy) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | 函数用于销毁位图对象并回收该对象占有内存。 |
| OH_Drawing_BrushDestroy&nbsp;(OH_Drawing_Brush&nbsp;\*) | void<br/>函数用于销毁画刷对象并回收该对象占有的内存。 | | [OH_Drawing_BitmapBuild](#oh_drawing_bitmapbuild) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const uint32_t width, const uint32_t height, const [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) \*) | 函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式。 |
| OH_Drawing_BrushIsAntiAlias&nbsp;(const&nbsp;OH_Drawing_Brush&nbsp;\*) | bool<br/>函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_BitmapGetWidth](#oh_drawing_bitmapgetwidth) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | 该函数用于获取指定位图的宽度。 |
| OH_Drawing_BrushSetAntiAlias&nbsp;(OH_Drawing_Brush&nbsp;\*,&nbsp;bool) | void<br/>函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_BitmapGetHeight](#oh_drawing_bitmapgetheight) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | 函数用于获取指定位图的高度。 |
| OH_Drawing_BrushGetColor&nbsp;(const&nbsp;OH_Drawing_Brush&nbsp;\*) | uint32_t<br/>函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_BitmapGetPixels](#oh_drawing_bitmapgetpixels) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | 函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据。 |
| OH_Drawing_BrushSetColor&nbsp;(OH_Drawing_Brush&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_BrushCreate](#oh_drawing_brushcreate) (void) | 函数用于创建一个画刷对象。 |
| OH_Drawing_CanvasCreate&nbsp;(void) | OH_Drawing_Canvas&nbsp;\*<br/>函数用于创建一个画布对象 | | [OH_Drawing_BrushDestroy](#oh_drawing_brushdestroy) ([OH_Drawing_Brush](#oh_drawing_brush) \*) | 函数用于销毁画刷对象并回收该对象占有的内存。 |
| OH_Drawing_CanvasDestroy&nbsp;(OH_Drawing_Canvas&nbsp;\*) | void<br/>函数用于销毁画布对象并回收该对象占有的内存 | | [OH_Drawing_BrushIsAntiAlias](#oh_drawing_brushisantialias) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | 函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理。 |
| OH_Drawing_CanvasBind&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;OH_Drawing_Bitmap&nbsp;\*) | void<br/>函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染) | | [OH_Drawing_BrushSetAntiAlias](#oh_drawing_brushsetantialias) ([OH_Drawing_Brush](#oh_drawing_brush) \*, bool) | 函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理。 |
| OH_Drawing_CanvasAttachPen&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;const&nbsp;OH_Drawing_Pen&nbsp;\*) | void<br/>函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓 | | [OH_Drawing_BrushGetColor](#oh_drawing_brushgetcolor) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | 函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示。 |
| OH_Drawing_CanvasDetachPen&nbsp;(OH_Drawing_Canvas&nbsp;\*) | void<br/>函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓 | | [OH_Drawing_BrushSetColor](#oh_drawing_brushsetcolor) ([OH_Drawing_Brush](#oh_drawing_brush) \*, uint32_t color) | 函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示。 |
| OH_Drawing_CanvasAttachBrush&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;const&nbsp;OH_Drawing_Brush&nbsp;\*) | void<br/>函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状 | | [OH_Drawing_CanvasCreate](#oh_drawing_canvascreate) (void) | 函数用于创建一个画布对象。 |
| OH_Drawing_CanvasDetachBrush&nbsp;(OH_Drawing_Canvas&nbsp;\*) | void<br/>函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状 | | [OH_Drawing_CanvasDestroy](#oh_drawing_canvasdestroy) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | 函数用于销毁画布对象并回收该对象占有的内存。 |
| OH_Drawing_CanvasSave&nbsp;(OH_Drawing_Canvas&nbsp;\*) | void<br/>函数用于保存当前画布的状态(画布矩阵)到一个栈顶 | | [OH_Drawing_CanvasBind](#oh_drawing_canvasbind) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | 函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染)。 |
| OH_Drawing_CanvasRestore&nbsp;(OH_Drawing_Canvas&nbsp;\*) | void<br/>函数用于恢复保存在栈顶的画布状态(画布矩阵) | | [OH_Drawing_CanvasAttachPen](#oh_drawing_canvasattachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓。 |
| OH_Drawing_CanvasDrawLine&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;float&nbsp;x1,&nbsp;float&nbsp;y1,&nbsp;float&nbsp;x2,&nbsp;float&nbsp;y2) | void<br/>函数用于画一条直线段 | | [OH_Drawing_CanvasDetachPen](#oh_drawing_canvasdetachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | 函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓。 |
| OH_Drawing_CanvasDrawPath&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;const&nbsp;OH_Drawing_Path&nbsp;\*) | void<br/>函数用于画一个自定义路径 | | [OH_Drawing_CanvasAttachBrush](#oh_drawing_canvasattachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | 函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状。 |
| OH_Drawing_CanvasClear&nbsp;(OH_Drawing_Canvas&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于使用指定颜色去清空画布 | | [OH_Drawing_CanvasDetachBrush](#oh_drawing_canvasdetachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | 函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状。 |
| OH_Drawing_ColorSetArgb&nbsp;(uint32_t&nbsp;alpha,&nbsp;uint32_t&nbsp;red,&nbsp;uint32_t&nbsp;green,&nbsp;uint32_t&nbsp;blue) | uint32_t<br/>函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量 | | [OH_Drawing_CanvasSave](#oh_drawing_canvassave) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | 函数用于保存当前画布的状态(画布矩阵)到一个栈顶。 |
| OH_Drawing_CreateFontCollection&nbsp;(void) | OH_Drawing_FontCollection&nbsp;\*<br/>创建OH_Drawing_FontCollection | | [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | 函数用于恢复保存在栈顶的画布状态(画布矩阵)。 |
| OH_Drawing_DestroyFontCollection&nbsp;(OH_Drawing_FontCollection&nbsp;\*) | void<br/>释放被OH_Drawing_FontCollection对象占据的内存 | | [OH_Drawing_CanvasDrawLine](#oh_drawing_canvasdrawline) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float x1, float y1, float x2, float y2) | 函数用于画一条直线段。 |
| OH_Drawing_PathCreate&nbsp;(void) | OH_Drawing_Path&nbsp;\*<br/>函数用于创建一个路径对象 | | [OH_Drawing_CanvasDrawPath](#oh_drawing_canvasdrawpath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Path](#oh_drawing_path) \*) | 函数用于画一个自定义路径。 |
| OH_Drawing_PathDestroy&nbsp;(OH_Drawing_Path&nbsp;\*) | void<br/>函数用于销毁路径对象并回收该对象占有的内存 | | [OH_Drawing_CanvasClear](#oh_drawing_canvasclear) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, uint32_t color) | 函数用于使用指定颜色去清空画布。 |
| OH_Drawing_PathMoveTo&nbsp;(OH_Drawing_Path&nbsp;\*,&nbsp;float&nbsp;x,&nbsp;float&nbsp;y) | void<br/>函数用于设置自定义路径的起始点位置 | | [OH_Drawing_ColorSetArgb](#oh_drawing_colorsetargb) (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue) | 函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量。 |
| OH_Drawing_PathLineTo&nbsp;(OH_Drawing_Path&nbsp;\*,&nbsp;float&nbsp;x,&nbsp;float&nbsp;y) | void<br/>函数用于添加一条从路径的最后点位置到目标点位置的线段 | | [OH_Drawing_CreateFontCollection](#oh_drawing_createfontcollection) (void) | 创建OH_Drawing_FontCollection。 |
| OH_Drawing_PathArcTo&nbsp;(OH_Drawing_Path&nbsp;\*,&nbsp;float&nbsp;x1,&nbsp;float&nbsp;y1,&nbsp;float&nbsp;x2,&nbsp;float&nbsp;y2,&nbsp;float&nbsp;startDeg,&nbsp;float&nbsp;sweepDeg) | void<br/>函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆,&nbsp;然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段 | | [OH_Drawing_DestroyFontCollection](#oh_drawing_destroyfontcollection) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | 释放被OH_Drawing_FontCollection对象占据的内存。 |
| OH_Drawing_PathQuadTo&nbsp;(OH_Drawing_Path&nbsp;\*,&nbsp;float&nbsp;ctrlX,&nbsp;float&nbsp;ctrlY,&nbsp;float&nbsp;endX,&nbsp;float&nbsp;endY) | void<br/>函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线 | | [OH_Drawing_PathCreate](#oh_drawing_pathcreate) (void) | 函数用于创建一个路径对象。 |
| OH_Drawing_PathCubicTo&nbsp;(OH_Drawing_Path&nbsp;\*,&nbsp;float&nbsp;ctrlX1,&nbsp;float&nbsp;ctrlY1,&nbsp;float&nbsp;ctrlX2,&nbsp;float&nbsp;ctrlY2,&nbsp;float&nbsp;endX,&nbsp;float&nbsp;endY) | void<br/>函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线 | | [OH_Drawing_PathDestroy](#oh_drawing_pathdestroy) ([OH_Drawing_Path](#oh_drawing_path) \*) | 函数用于销毁路径对象并回收该对象占有的内存。 |
| OH_Drawing_PathClose&nbsp;(OH_Drawing_Path&nbsp;\*) | void<br/>函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段 | | [OH_Drawing_PathMoveTo](#oh_drawing_pathmoveto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | 函数用于设置自定义路径的起始点位置。 |
| OH_Drawing_PathReset&nbsp;(OH_Drawing_Path&nbsp;\*) | void<br/>函数用于重置自定义路径数据 | | [OH_Drawing_PathLineTo](#oh_drawing_pathlineto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | 函数用于添加一条从路径的最后点位置到目标点位置的线段。 |
| OH_Drawing_PenCreate&nbsp;(void) | OH_Drawing_Pen&nbsp;\*<br/>函数用于创建一个画笔对象 | | [OH_Drawing_PathArcTo](#oh_drawing_patharcto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) | 函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆, 然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段。 |
| OH_Drawing_PenDestroy&nbsp;(OH_Drawing_Pen&nbsp;\*) | void<br/>函数用于销毁画笔对象并回收该对象占有的内存 | | [OH_Drawing_PathQuadTo](#oh_drawing_pathquadto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | 函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线。 |
| OH_Drawing_PenIsAntiAlias&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | bool<br/>函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_PathCubicTo](#oh_drawing_pathcubicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | 函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线。 |
| OH_Drawing_PenSetAntiAlias&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;bool) | void<br/>函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_PathClose](#oh_drawing_pathclose) ([OH_Drawing_Path](#oh_drawing_path) \*) | 函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段。 |
| OH_Drawing_PenGetColor&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | uint32_t<br/>函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_PathReset](#oh_drawing_pathreset) ([OH_Drawing_Path](#oh_drawing_path) \*) | 函数用于重置自定义路径数据。 |
| OH_Drawing_PenSetColor&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_PenCreate](#oh_drawing_pencreate) (void) | 函数用于创建一个画笔对象。 |
| OH_Drawing_PenGetWidth&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | float<br/>函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 | | [OH_Drawing_PenDestroy](#oh_drawing_pendestroy) ([OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于销毁画笔对象并回收该对象占有的内存。 |
| OH_Drawing_PenSetWidth&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;float&nbsp;width) | void<br/>函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 | | [OH_Drawing_PenIsAntiAlias](#oh_drawing_penisantialias) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理。 |
| OH_Drawing_PenGetMiterLimit&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | float<br/>函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 | | [OH_Drawing_PenSetAntiAlias](#oh_drawing_pensetantialias) ([OH_Drawing_Pen](#oh_drawing_pen) \*, bool) | 函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理。 |
| OH_Drawing_PenSetMiterLimit&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;float&nbsp;miter) | void<br/>函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 | | [OH_Drawing_PenGetColor](#oh_drawing_pengetcolor) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示。 |
| OH_Drawing_PenGetCap&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | OH_Drawing_PenLineCapStyle<br/>函数用于获取画笔笔帽的样式 | | [OH_Drawing_PenSetColor](#oh_drawing_pensetcolor) ([OH_Drawing_Pen](#oh_drawing_pen) \*, uint32_t color) | 函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示。 |
| OH_Drawing_PenSetCap&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;OH_Drawing_PenLineCapStyle) | void<br/>函数用于设置画笔笔帽样式 | | [OH_Drawing_PenGetWidth](#oh_drawing_pengetwidth) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度。 |
| OH_Drawing_PenGetJoin&nbsp;(const&nbsp;OH_Drawing_Pen&nbsp;\*) | OH_Drawing_PenLineJoinStyle<br/>函数用于获取画笔绘制折线转角的样式 | | [OH_Drawing_PenSetWidth](#oh_drawing_pensetwidth) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float width) | 函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度。 |
| OH_Drawing_PenSetJoin&nbsp;(OH_Drawing_Pen&nbsp;\*,&nbsp;OH_Drawing_PenLineJoinStyle) | void<br/>函数用于设置画笔绘制转角的样式 | | [OH_Drawing_PenGetMiterLimit](#oh_drawing_pengetmiterlimit) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角。 |
| OH_Drawing_CreateTypographyStyle&nbsp;(void) | OH_Drawing_TypographyStyle&nbsp;\*<br/>创建OH_Drawing_TypographyStyle | | [OH_Drawing_PenSetMiterLimit](#oh_drawing_pensetmiterlimit) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float miter) | 函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角。 |
| OH_Drawing_DestroyTypographyStyle&nbsp;(OH_Drawing_TypographyStyle&nbsp;\*) | void<br/>释放被OH_Drawing_TypographyStyle对象占据的内存 | | [OH_Drawing_PenGetCap](#oh_drawing_pengetcap) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取画笔笔帽的样式。 |
| OH_Drawing_SetTypographyTextDirection&nbsp;(OH_Drawing_TypographyStyle&nbsp;\*,&nbsp;int) | void<br/>设置文本方向 | | [OH_Drawing_PenSetCap](#oh_drawing_pensetcap) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle)) | 函数用于设置画笔笔帽样式。 |
| OH_Drawing_SetTypographyTextAlign&nbsp;(OH_Drawing_TypographyStyle&nbsp;\*,&nbsp;int) | void<br/>设置文本对齐方式 | | [OH_Drawing_PenGetJoin](#oh_drawing_pengetjoin) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | 函数用于获取画笔绘制折线转角的样式。 |
| OH_Drawing_SetTypographyTextMaxLines&nbsp;(OH_Drawing_TypographyStyle&nbsp;\*,&nbsp;int) | void<br/>设置文本最大行数 | | [OH_Drawing_PenSetJoin](#oh_drawing_pensetjoin) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle)) | 函数用于设置画笔绘制转角的样式。 |
| OH_Drawing_CreateTextStyle&nbsp;(void) | OH_Drawing_TextStyle&nbsp;\*<br/>创建OH_Drawing_TextStyle | | [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle) (void) | 创建OH_Drawing_TypographyStyle。 |
| OH_Drawing_DestroyTextStyle&nbsp;(OH_Drawing_TextStyle&nbsp;\*) | void<br/>释放被OH_Drawing_TextStyle对象占据的内存 | | [OH_Drawing_DestroyTypographyStyle](#oh_drawing_destroytypographystyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | 释放被OH_Drawing_TypographyStyle对象占据的内存。 |
| OH_Drawing_SetTextStyleColor&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;uint32_t) | void<br/>设置文本颜色 | | [OH_Drawing_SetTypographyTextDirection](#oh_drawing_settypographytextdirection) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | 设置文本方向。 |
| OH_Drawing_SetTextStyleFontSize&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;double) | void<br/>设置字号 | | [OH_Drawing_SetTypographyTextAlign](#oh_drawing_settypographytextalign) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | 设置文本对齐方式。 |
| OH_Drawing_SetTextStyleFontWeight&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;int) | void<br/>设置字重 | | [OH_Drawing_SetTypographyTextMaxLines](#oh_drawing_settypographytextmaxlines) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | 设置文本最大行数。 |
| OH_Drawing_SetTextStyleBaseLine&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;int) | void<br/>设置字体基线位置 | | [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle) (void) | 创建OH_Drawing_TextStyle。 |
| OH_Drawing_SetTextStyleDecoration&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;int) | void<br/>设置装饰 | | [OH_Drawing_DestroyTextStyle](#oh_drawing_destroytextstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | 释放被OH_Drawing_TextStyle对象占据的内存。 |
| OH_Drawing_SetTextStyleDecorationColor&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;uint32_t) | void<br/>设置装饰颜色 | | [OH_Drawing_SetTextStyleColor](#oh_drawing_settextstylecolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | 设置文本颜色。 |
| OH_Drawing_SetTextStyleFontHeight&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;double) | void<br/>设置字体高度 | | [OH_Drawing_SetTextStyleFontSize](#oh_drawing_settextstylefontsize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | 设置字号。 |
| OH_Drawing_SetTextStyleFontFamilies&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;int,&nbsp;const&nbsp;char&nbsp;\*fontFamilies[]) | void<br/>设置字体类型 | | [OH_Drawing_SetTextStyleFontWeight](#oh_drawing_settextstylefontweight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | 设置字重。 |
| OH_Drawing_SetTextStyleFontStyle&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;int) | void<br/>设置字体风格 | | [OH_Drawing_SetTextStyleBaseLine](#oh_drawing_settextstylebaseline) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | 设置字体基线位置。 |
| OH_Drawing_SetTextStyleLocale&nbsp;(OH_Drawing_TextStyle&nbsp;\*,&nbsp;const&nbsp;char&nbsp;\*) | void<br/>设置语言区域 | | [OH_Drawing_SetTextStyleDecoration](#oh_drawing_settextstyledecoration) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | 设置装饰。 |
| OH_Drawing_CreateTypographyHandler&nbsp;(OH_Drawing_TypographyStyle&nbsp;\*,&nbsp;OH_Drawing_FontCollection&nbsp;\*) | OH_Drawing_TypographyCreate&nbsp;\*<br/>创建指向OH_Drawing_TypographyCreate对象的指针 | | [OH_Drawing_SetTextStyleDecorationColor](#oh_drawing_settextstyledecorationcolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | 设置装饰颜色。 |
| OH_Drawing_DestroyTypographyHandler&nbsp;(OH_Drawing_TypographyCreate&nbsp;\*) | void<br/>释放被OH_Drawing_TypographyCreate对象占据的内存 | | [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | 设置字体高度。 |
| OH_Drawing_TypographyHandlerPushStyle&nbsp;(OH_Drawing_TypographyCreate&nbsp;\*,&nbsp;OH_Drawing_TextStyle&nbsp;\*) | void<br/>设置排版风格 | | [OH_Drawing_SetTextStyleFontFamilies](#oh_drawing_settextstylefontfamilies) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int, const char \*fontFamilies[]) | 设置字体类型。 |
| OH_Drawing_TypographyHandlerAddText&nbsp;(OH_Drawing_TypographyCreate&nbsp;\*,&nbsp;const&nbsp;char&nbsp;\*) | void<br/>设置文本内容 | | [OH_Drawing_SetTextStyleFontStyle](#oh_drawing_settextstylefontstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | 设置字体风格。 |
| OH_Drawing_TypographyHandlerPop&nbsp;(OH_Drawing_TypographyCreate&nbsp;\*) | void<br/>排版弹出 | | [OH_Drawing_SetTextStyleLocale](#oh_drawing_settextstylelocale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*) | 设置语言区域。 |
| OH_Drawing_CreateTypography&nbsp;(OH_Drawing_TypographyCreate&nbsp;\*) | OH_Drawing_Typography&nbsp;\*<br/>创建OH_Drawing_Typography | | [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | 创建指向OH_Drawing_TypographyCreate对象的指针。 |
| OH_Drawing_DestroyTypography&nbsp;(OH_Drawing_Typography&nbsp;\*) | void<br/>释放OH_Drawing_Typography对象占据的内存 | | [OH_Drawing_DestroyTypographyHandler](#oh_drawing_destroytypographyhandler) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | 释放被OH_Drawing_TypographyCreate对象占据的内存。 |
| OH_Drawing_TypographyLayout&nbsp;(OH_Drawing_Typography&nbsp;\*,&nbsp;double) | void<br/>排版布局 | | [OH_Drawing_TypographyHandlerPushTextStyle](#oh_drawing_typographyhandlerpushtextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | 设置排版风格。 |
| OH_Drawing_TypographyPaint&nbsp;(OH_Drawing_Typography&nbsp;\*,&nbsp;OH_Drawing_Canvas&nbsp;\*,&nbsp;double,&nbsp;double) | void<br/>显示文本 | | [OH_Drawing_TypographyHandlerAddText](#oh_drawing_typographyhandleraddtext) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, const char \*) | 设置文本内容。 |
| [OH_Drawing_TypographyHandlerPopTextStyle](#oh_drawing_typographyhandlerpoptextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | 排版弹出。 |
| [OH_Drawing_CreateTypography](#oh_drawing_createtypography) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | 创建OH_Drawing_Typography。 |
## **Details** | [OH_Drawing_DestroyTypography](#oh_drawing_destroytypography) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | 释放OH_Drawing_Typography对象占据的内存。 |
| [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double) | 排版布局。 |
| [OH_Drawing_TypographyPaint](#oh_drawing_typographypaint) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_Canvas](#oh_drawing_canvas) \*, double, double) | 显示文本。 |
## **Typedef**
## 详细描述
## 类型定义说明
### OH_Drawing_Bitmap ### OH_Drawing_Bitmap
...@@ -175,10 +169,14 @@ Drawing模块提供包括2D图形渲染、文字绘制和图片显示等功能 ...@@ -175,10 +169,14 @@ Drawing模块提供包括2D图形渲染、文字绘制和图片显示等功能
typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap
``` ```
**Description:** **描述:**
OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据 OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据
**自从:**
8
### OH_Drawing_Brush ### OH_Drawing_Brush
...@@ -187,10 +185,14 @@ OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描 ...@@ -187,10 +185,14 @@ OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描
typedef struct OH_Drawing_Brush OH_Drawing_Brush typedef struct OH_Drawing_Brush OH_Drawing_Brush
``` ```
**Description:** **描述:**
OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色 OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色
**自从:**
8
### OH_Drawing_Canvas ### OH_Drawing_Canvas
...@@ -199,10 +201,14 @@ OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜 ...@@ -199,10 +201,14 @@ OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜
typedef struct OH_Drawing_Canvas OH_Drawing_Canvas typedef struct OH_Drawing_Canvas OH_Drawing_Canvas
``` ```
**Description:** **描述:**
OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字 OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字
**自从:**
8
### OH_Drawing_FontCollection ### OH_Drawing_FontCollection
...@@ -211,10 +217,14 @@ OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在 ...@@ -211,10 +217,14 @@ OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在
typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection
``` ```
**Description:** **描述:**
OH_Drawing_FontCollection用于加载字体 OH_Drawing_FontCollection用于加载字体
**自从:**
8
### OH_Drawing_Path ### OH_Drawing_Path
...@@ -223,10 +233,14 @@ OH_Drawing_FontCollection用于加载字体 ...@@ -223,10 +233,14 @@ OH_Drawing_FontCollection用于加载字体
typedef struct OH_Drawing_Path OH_Drawing_Path typedef struct OH_Drawing_Path OH_Drawing_Path
``` ```
**Description:** **描述:**
OH_Drawing_Path定义为路径,路径用于自定义各种形状 OH_Drawing_Path定义为路径,路径用于自定义各种形状
**自从:**
8
### OH_Drawing_Pen ### OH_Drawing_Pen
...@@ -235,10 +249,14 @@ OH_Drawing_Path定义为路径,路径用于自定义各种形状 ...@@ -235,10 +249,14 @@ OH_Drawing_Path定义为路径,路径用于自定义各种形状
typedef struct OH_Drawing_Pen OH_Drawing_Pen typedef struct OH_Drawing_Pen OH_Drawing_Pen
``` ```
**Description:** **描述:**
OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色 OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色
**自从:**
8
### OH_Drawing_TextStyle ### OH_Drawing_TextStyle
...@@ -247,10 +265,14 @@ OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和 ...@@ -247,10 +265,14 @@ OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和
typedef struct OH_Drawing_TextStyle OH_Drawing_TextStyle typedef struct OH_Drawing_TextStyle OH_Drawing_TextStyle
``` ```
**Description:** **描述:**
OH_Drawing_TextStyle用于管理字体颜色、装饰等 OH_Drawing_TextStyle用于管理字体颜色、装饰等
**自从:**
8
### OH_Drawing_Typography ### OH_Drawing_Typography
...@@ -259,10 +281,14 @@ OH_Drawing_TextStyle用于管理字体颜色、装饰等 ...@@ -259,10 +281,14 @@ OH_Drawing_TextStyle用于管理字体颜色、装饰等
typedef struct OH_Drawing_Typography OH_Drawing_Typography typedef struct OH_Drawing_Typography OH_Drawing_Typography
``` ```
**Description:** **描述:**
OH_Drawing_Typography用于管理排版的布局和显示等 OH_Drawing_Typography用于管理排版的布局和显示等
**自从:**
8
### OH_Drawing_TypographyCreate ### OH_Drawing_TypographyCreate
...@@ -271,9 +297,13 @@ OH_Drawing_Typography用于管理排版的布局和显示等 ...@@ -271,9 +297,13 @@ OH_Drawing_Typography用于管理排版的布局和显示等
typedef struct OH_Drawing_TypographyCreate OH_Drawing_TypographyCreate typedef struct OH_Drawing_TypographyCreate OH_Drawing_TypographyCreate
``` ```
**Description:** **描述:**
OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography. OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography
**自从:**
8
### OH_Drawing_TypographyStyle ### OH_Drawing_TypographyStyle
...@@ -283,12 +313,16 @@ OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography. ...@@ -283,12 +313,16 @@ OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography.
typedef struct OH_Drawing_TypographyStyle OH_Drawing_TypographyStyle typedef struct OH_Drawing_TypographyStyle OH_Drawing_TypographyStyle
``` ```
**Description:** **描述:**
OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等 OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等
**自从:**
8
## **Enumeration Type** ## 枚举类型说明
### OH_Drawing_AlphaFormat ### OH_Drawing_AlphaFormat
...@@ -298,17 +332,21 @@ OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等 ...@@ -298,17 +332,21 @@ OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等
enum OH_Drawing_AlphaFormat enum OH_Drawing_AlphaFormat
``` ```
**Description:** **描述:**
OH_Drawing_AlphaFormat用于描述位图像素的透明度分量 OH_Drawing_AlphaFormat用于描述位图像素的透明度分量
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| ALPHA_FORMAT_UNKNOWN | 未知格式 | | ALPHA_FORMAT_UNKNOWN | 未知格式 |
| ALPHA_FORMAT_OPAQUE | 位图无透明度 | | ALPHA_FORMAT_OPAQUE | 位图无透明度 |
| ALPHA_FORMAT_PREMUL | 每个像素的颜色组件由透明度分量预先乘以 | | ALPHA_FORMAT_PREMUL | 每个像素的颜色组件由透明度分量预先乘以 |
| ALPHA_FORMAT_UNPREMUL | 每个像素的颜色组件未由透明度分量预先乘以 | | ALPHA_FORMAT_UNPREMUL | 每个像素的颜色组件未由透明度分量预先乘以 |
**自从:**
8
### OH_Drawing_ColorFormat ### OH_Drawing_ColorFormat
...@@ -317,11 +355,11 @@ OH_Drawing_AlphaFormat用于描述位图像素的透明度分量 ...@@ -317,11 +355,11 @@ OH_Drawing_AlphaFormat用于描述位图像素的透明度分量
enum OH_Drawing_ColorFormat enum OH_Drawing_ColorFormat
``` ```
**Description:** **描述:**
OH_Drawing_ColorFormat用于描述位图像素的存储格式 OH_Drawing_ColorFormat用于描述位图像素的存储格式
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| COLOR_FORMAT_UNKNOWN | 未知格式. | | COLOR_FORMAT_UNKNOWN | 未知格式. |
| COLOR_FORMAT_ALPHA_8 | 每个像素用一个8位的量表示,8个位比特位表示透明度 | | COLOR_FORMAT_ALPHA_8 | 每个像素用一个8位的量表示,8个位比特位表示透明度 |
...@@ -330,6 +368,10 @@ OH_Drawing_ColorFormat用于描述位图像素的存储格式 ...@@ -330,6 +368,10 @@ OH_Drawing_ColorFormat用于描述位图像素的存储格式
| COLOR_FORMAT_RGBA_8888 | 每个像素用一个32位的量表示,高位到低位依次是8个比特位表示透明度,8个比特位表示红,8个比特位表示绿,8个比特位表示蓝 | | COLOR_FORMAT_RGBA_8888 | 每个像素用一个32位的量表示,高位到低位依次是8个比特位表示透明度,8个比特位表示红,8个比特位表示绿,8个比特位表示蓝 |
| COLOR_FORMAT_BGRA_8888 | 每个像素用一个32位的量表示,高位到低位依次是8个比特位表示蓝,8个比特位表示绿,8个比特位表示红,8个比特位表示透明度 | | COLOR_FORMAT_BGRA_8888 | 每个像素用一个32位的量表示,高位到低位依次是8个比特位表示蓝,8个比特位表示绿,8个比特位表示红,8个比特位表示透明度 |
**自从:**
8
### OH_Drawing_FontStyle ### OH_Drawing_FontStyle
...@@ -338,15 +380,19 @@ OH_Drawing_ColorFormat用于描述位图像素的存储格式 ...@@ -338,15 +380,19 @@ OH_Drawing_ColorFormat用于描述位图像素的存储格式
enum OH_Drawing_FontStyle enum OH_Drawing_FontStyle
``` ```
**Description:** **描述:**
区分字体是否为斜体 区分字体是否为斜体
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| FONT_STYLE_NORMAL | 非斜体 | | FONT_STYLE_NORMAL | 非斜体 |
| FONT_STYLE_ITALIC | 斜体 | | FONT_STYLE_ITALIC | 斜体 |
**自从:**
8
### OH_Drawing_FontWeight ### OH_Drawing_FontWeight
...@@ -355,11 +401,11 @@ enum OH_Drawing_FontStyle ...@@ -355,11 +401,11 @@ enum OH_Drawing_FontStyle
enum OH_Drawing_FontWeight enum OH_Drawing_FontWeight
``` ```
**Description:** **描述:**
字重 字重
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| FONT_WEIGHT_100 | 字重为thin | | FONT_WEIGHT_100 | 字重为thin |
| FONT_WEIGHT_200 | 字重为extra-light | | FONT_WEIGHT_200 | 字重为extra-light |
...@@ -371,6 +417,10 @@ enum OH_Drawing_FontWeight ...@@ -371,6 +417,10 @@ enum OH_Drawing_FontWeight
| FONT_WEIGHT_800 | 字重为extra-bold | | FONT_WEIGHT_800 | 字重为extra-bold |
| FONT_WEIGHT_900 | 字重为black | | FONT_WEIGHT_900 | 字重为black |
**自从:**
8
### OH_Drawing_PenLineCapStyle ### OH_Drawing_PenLineCapStyle
...@@ -379,16 +429,20 @@ enum OH_Drawing_FontWeight ...@@ -379,16 +429,20 @@ enum OH_Drawing_FontWeight
enum OH_Drawing_PenLineCapStyle enum OH_Drawing_PenLineCapStyle
``` ```
**Description:** **描述:**
枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式 枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| LINE_FLAT_CAP | 没有笔帽样式,线条头尾端点处横切 | | LINE_FLAT_CAP | 没有笔帽样式,线条头尾端点处横切 |
| LINE_SQUARE_CAP | 笔帽的样式为方框,线条的头尾端点处多出一个方框,方框宽度和线段一样宽,高度时线段厚度的一半 | | LINE_SQUARE_CAP | 笔帽的样式为方框,线条的头尾端点处多出一个方框,方框宽度和线段一样宽,高度时线段厚度的一半 |
| LINE_ROUND_CAP | 笔帽的样式为圆弧,线条的头尾端点处多出一个半圆弧,半圆的直径与线段厚度一致 | | LINE_ROUND_CAP | 笔帽的样式为圆弧,线条的头尾端点处多出一个半圆弧,半圆的直径与线段厚度一致 |
**自从:**
8
### OH_Drawing_PenLineJoinStyle ### OH_Drawing_PenLineJoinStyle
...@@ -397,16 +451,20 @@ enum OH_Drawing_PenLineCapStyle ...@@ -397,16 +451,20 @@ enum OH_Drawing_PenLineCapStyle
enum OH_Drawing_PenLineJoinStyle enum OH_Drawing_PenLineJoinStyle
``` ```
**Description:** **描述:**
枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式 枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| LINE_MITER_JOIN | 转角类型为尖角,如果折线角度比较小,则尖角会很长,需要使用限制值(miter&nbsp;limit)进行限制 | | LINE_MITER_JOIN | 转角类型为尖角,如果折线角度比较小,则尖角会很长,需要使用限制值(miter limit)进行限制 |
| LINE_ROUND_JOIN | 转角类型为圆头 | | LINE_ROUND_JOIN | 转角类型为圆头 |
| LINE_BEVEL_JOIN | 转角类型为平头 | | LINE_BEVEL_JOIN | 转角类型为平头 |
**自从:**
8
### OH_Drawing_TextAlign ### OH_Drawing_TextAlign
...@@ -415,18 +473,22 @@ enum OH_Drawing_PenLineJoinStyle ...@@ -415,18 +473,22 @@ enum OH_Drawing_PenLineJoinStyle
enum OH_Drawing_TextAlign enum OH_Drawing_TextAlign
``` ```
**Description:** **描述:**
文字对齐方式 文字对齐方式
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| TEXT_ALIGN_LEFT | 左对齐 | | TEXT_ALIGN_LEFT | 左对齐 |
| TEXT_ALIGN_RIGHT | 右对齐 | | TEXT_ALIGN_RIGHT | 右对齐 |
| TEXT_ALIGN_CENTER | 居中对齐 | | TEXT_ALIGN_CENTER | 居中对齐 |
| TEXT_ALIGN_JUSTIFY | 两端对齐,即紧靠左和右边缘,中间单词空隙由空格填充&nbsp;最后一行除外 | | TEXT_ALIGN_JUSTIFY | 两端对齐,即紧靠左和右边缘,中间单词空隙由空格填充 最后一行除外 |
| TEXT_ALIGN_START | 当OH_Drawing_TextDirection是TEXT_DIRECTION_LTR时,&nbsp;TEXT_ALIGN_START和TEXT_ALIGN_LEFT相同;&nbsp;类似地,当OH_Drawing_TextDirection是TEXT_DIRECTION_RTL时,&nbsp;TEXT_ALIGN_START和TEXT_ALIGN_RIGHT相同。 | | TEXT_ALIGN_START | 当OH_Drawing_TextDirection是TEXT_DIRECTION_LTR时, TEXT_ALIGN_START和TEXT_ALIGN_LEFT相同; 类似地,当OH_Drawing_TextDirection是TEXT_DIRECTION_RTL时, TEXT_ALIGN_START和TEXT_ALIGN_RIGHT相同。 |
| TEXT_ALIGN_END | 当OH_Drawing_TextDirection是TEXT_DIRECTION_LTR时,&nbsp;TEXT_ALIGN_END和TEXT_ALIGN_RIGHT相同;&nbsp;类似地,当OH_Drawing_TextDirection是TEXT_DIRECTION_RTL时,&nbsp;TEXT_ALIGN_END和TEXT_ALIGN_LEFT相同。 | | TEXT_ALIGN_END | 当OH_Drawing_TextDirection是TEXT_DIRECTION_LTR时, TEXT_ALIGN_END和TEXT_ALIGN_RIGHT相同; 类似地,当OH_Drawing_TextDirection是TEXT_DIRECTION_RTL时, TEXT_ALIGN_END和TEXT_ALIGN_LEFT相同。 |
**自从:**
8
### OH_Drawing_TextBaseline ### OH_Drawing_TextBaseline
...@@ -436,15 +498,19 @@ enum OH_Drawing_TextAlign ...@@ -436,15 +498,19 @@ enum OH_Drawing_TextAlign
enum OH_Drawing_TextBaseline enum OH_Drawing_TextBaseline
``` ```
**Description:** **描述:**
基线位置 基线位置
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| TEXT_BASELINE_ALPHABETIC | 用于表音文字,基线在中间偏下的位置 | | TEXT_BASELINE_ALPHABETIC | 用于表音文字,基线在中间偏下的位置 |
| TEXT_BASELINE_IDEOGRAPHIC | 用于表意文字,基线位于底部 | | TEXT_BASELINE_IDEOGRAPHIC | 用于表意文字,基线位于底部 |
**自从:**
8
### OH_Drawing_TextDecoration ### OH_Drawing_TextDecoration
...@@ -453,17 +519,21 @@ enum OH_Drawing_TextBaseline ...@@ -453,17 +519,21 @@ enum OH_Drawing_TextBaseline
enum OH_Drawing_TextDecoration enum OH_Drawing_TextDecoration
``` ```
**Description:** **描述:**
文本装饰 文本装饰
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| TEXT_DECORATION_NONE | 无装饰 | | TEXT_DECORATION_NONE | 无装饰 |
| TEXT_DECORATION_UNDERLINE | 下划线 | | TEXT_DECORATION_UNDERLINE | 下划线 |
| TEXT_DECORATION_OVERLINE | 上划线 | | TEXT_DECORATION_OVERLINE | 上划线 |
| TEXT_DECORATION_LINE_THROUGH | 删除线 | | TEXT_DECORATION_LINE_THROUGH | 删除线 |
**自从:**
8
### OH_Drawing_TextDirection ### OH_Drawing_TextDirection
...@@ -472,17 +542,21 @@ enum OH_Drawing_TextDecoration ...@@ -472,17 +542,21 @@ enum OH_Drawing_TextDecoration
enum OH_Drawing_TextDirection enum OH_Drawing_TextDirection
``` ```
**Description:** **描述:**
文字方向 文字方向
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| TEXT_DIRECTION_RTL | 方向:从右到左 | | TEXT_DIRECTION_RTL | 方向:从右到左 |
| TEXT_DIRECTION_LTR | 方向:从左到右 | | TEXT_DIRECTION_LTR | 方向:从左到右 |
**自从:**
8
## **Function** ## 函数说明
### OH_Drawing_BitmapBuild() ### OH_Drawing_BitmapBuild()
...@@ -492,21 +566,25 @@ enum OH_Drawing_TextDirection ...@@ -492,21 +566,25 @@ enum OH_Drawing_TextDirection
void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap * , const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat * ) void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap * , const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat * )
``` ```
**Description:** **描述:**
函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式 函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 |
| width | 参数是位图要初始化设置的宽度 | | width | 参数是位图要初始化设置的宽度 |
| height | 参数是位图要初始化设置的高度 | | height | 参数是位图要初始化设置的高度 |
| [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 参数是位图要初始化设置的像素格式,包括像素的颜色类型和透明度类型 | | [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 参数是位图要初始化设置的像素格式,包括像素的颜色类型和透明度类型 |
**自从:**
8
### OH_Drawing_BitmapCreate() ### OH_Drawing_BitmapCreate()
...@@ -515,16 +593,20 @@ void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap * , const uint32_t width, const u ...@@ -515,16 +593,20 @@ void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap * , const uint32_t width, const u
OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void ) OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void )
``` ```
**Description:** **描述:**
函数用于创建一个位图对象。 函数用于创建一个位图对象。
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
函数会返回一个指针,指针指向创建的位图对象 函数会返回一个指针,指针指向创建的位图对象
**自从:**
8
### OH_Drawing_BitmapDestroy() ### OH_Drawing_BitmapDestroy()
...@@ -533,18 +615,22 @@ OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void ) ...@@ -533,18 +615,22 @@ OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void )
void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap * ) void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap * )
``` ```
**Description:** **描述:**
函数用于销毁位图对象并回收该对象占有内存。 函数用于销毁位图对象并回收该对象占有内存。
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 |
**自从:**
8
### OH_Drawing_BitmapGetHeight() ### OH_Drawing_BitmapGetHeight()
...@@ -553,22 +639,26 @@ void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap * ) ...@@ -553,22 +639,26 @@ void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap * )
uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap * ) uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap * )
``` ```
**Description:** **描述:**
函数用于获取指定位图的高度 函数用于获取指定位图的高度
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 |
**Returns:** **返回:**
函数返回位图的高度 函数返回位图的高度
**自从:**
8
### OH_Drawing_BitmapGetPixels() ### OH_Drawing_BitmapGetPixels()
...@@ -577,22 +667,26 @@ uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap * ) ...@@ -577,22 +667,26 @@ uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap * )
void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap * ) void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap * )
``` ```
**Description:** **描述:**
函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据 函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 |
**Returns:** **返回:**
函数返回位图的像素地址 函数返回位图的像素地址
**自从:**
8
### OH_Drawing_BitmapGetWidth() ### OH_Drawing_BitmapGetWidth()
...@@ -601,22 +695,26 @@ void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap * ) ...@@ -601,22 +695,26 @@ void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap * )
uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap * ) uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap * )
``` ```
**Description:** **描述:**
该函数用于获取指定位图的宽度 该函数用于获取指定位图的宽度
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数是一个指向位图对象的指针 |
**Returns:** **返回:**
函数返回位图的宽度 函数返回位图的宽度
**自从:**
8
### OH_Drawing_BrushCreate() ### OH_Drawing_BrushCreate()
...@@ -625,16 +723,20 @@ uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap * ) ...@@ -625,16 +723,20 @@ uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap * )
OH_Drawing_Brush* OH_Drawing_BrushCreate (void ) OH_Drawing_Brush* OH_Drawing_BrushCreate (void )
``` ```
**Description:** **描述:**
函数用于创建一个画刷对象 函数用于创建一个画刷对象
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
函数会返回一个指针,指针指向创建的画刷对象 函数会返回一个指针,指针指向创建的画刷对象
**自从:**
8
### OH_Drawing_BrushDestroy() ### OH_Drawing_BrushDestroy()
...@@ -643,18 +745,22 @@ OH_Drawing_Brush* OH_Drawing_BrushCreate (void ) ...@@ -643,18 +745,22 @@ OH_Drawing_Brush* OH_Drawing_BrushCreate (void )
void OH_Drawing_BrushDestroy (OH_Drawing_Brush * ) void OH_Drawing_BrushDestroy (OH_Drawing_Brush * )
``` ```
**Description:** **描述:**
函数用于销毁画刷对象并回收该对象占有的内存。 函数用于销毁画刷对象并回收该对象占有的内存。
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Brush | 参数是一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数是一个指向画刷对象的指针 |
**自从:**
8
### OH_Drawing_BrushGetColor() ### OH_Drawing_BrushGetColor()
...@@ -663,22 +769,26 @@ void OH_Drawing_BrushDestroy (OH_Drawing_Brush * ) ...@@ -663,22 +769,26 @@ void OH_Drawing_BrushDestroy (OH_Drawing_Brush * )
uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush * ) uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush * )
``` ```
**Description:** **描述:**
函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Brush | 参数是一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数是一个指向画刷对象的指针 |
**Returns:** **返回:**
函数返回一个描述颜色的32位(ARGB)变量 函数返回一个描述颜色的32位(ARGB)变量
**自从:**
8
### OH_Drawing_BrushIsAntiAlias() ### OH_Drawing_BrushIsAntiAlias()
...@@ -687,22 +797,26 @@ uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush * ) ...@@ -687,22 +797,26 @@ uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush * )
bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush * ) bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush * )
``` ```
**Description:** **描述:**
函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Brush | 参数是一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数是一个指向画刷对象的指针 |
**Returns:** **返回:**
函数返回画刷对象是否设置抗锯齿属性,返回真则设置了抗锯齿,返回假则没有设置抗锯齿 函数返回画刷对象是否设置抗锯齿属性,返回真则设置了抗锯齿,返回假则没有设置抗锯齿
**自从:**
8
### OH_Drawing_BrushSetAntiAlias() ### OH_Drawing_BrushSetAntiAlias()
...@@ -711,19 +825,23 @@ bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush * ) ...@@ -711,19 +825,23 @@ bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush * )
void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush * , bool ) void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush * , bool )
``` ```
**Description:** **描述:**
函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理 函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Brush | 参数是一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数是一个指向画刷对象的指针 |
| bool | 参数真为抗锯齿,参数假则不做抗锯齿处理 | | bool | 参数真为抗锯齿,参数假则不做抗锯齿处理 |
**自从:**
8
### OH_Drawing_BrushSetColor() ### OH_Drawing_BrushSetColor()
...@@ -732,19 +850,23 @@ void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush * , bool ) ...@@ -732,19 +850,23 @@ void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush * , bool )
void OH_Drawing_BrushSetColor (OH_Drawing_Brush * , uint32_t color ) void OH_Drawing_BrushSetColor (OH_Drawing_Brush * , uint32_t color )
``` ```
**Description:** **描述:**
函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Brush | 参数是一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数是一个指向画刷对象的指针 |
| color | 参数是一个描述颜色的32位(ARGB)变量 | | color | 参数是一个描述颜色的32位(ARGB)变量 |
**自从:**
8
### OH_Drawing_CanvasAttachBrush() ### OH_Drawing_CanvasAttachBrush()
...@@ -753,19 +875,23 @@ void OH_Drawing_BrushSetColor (OH_Drawing_Brush * , uint32_t color ) ...@@ -753,19 +875,23 @@ void OH_Drawing_BrushSetColor (OH_Drawing_Brush * , uint32_t color )
void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas * , const OH_Drawing_Brush * ) void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas * , const OH_Drawing_Brush * )
``` ```
**Description:** **描述:**
函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状 函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| OH_Drawing_Brush | 参数为一个指向画刷对象的指针 | | OH_Drawing_Brush | 参数为一个指向画刷对象的指针 |
**自从:**
8
### OH_Drawing_CanvasAttachPen() ### OH_Drawing_CanvasAttachPen()
...@@ -774,19 +900,23 @@ void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas * , const OH_Drawing_Brush ...@@ -774,19 +900,23 @@ void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas * , const OH_Drawing_Brush
void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas * , const OH_Drawing_Pen * ) void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas * , const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓 函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| OH_Drawing_Pen | 参数为一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数为一个指向画笔对象的指针 |
**自从:**
8
### OH_Drawing_CanvasBind() ### OH_Drawing_CanvasBind()
...@@ -795,19 +925,23 @@ void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas * , const OH_Drawing_Pen * ) ...@@ -795,19 +925,23 @@ void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas * , const OH_Drawing_Pen * )
void OH_Drawing_CanvasBind (OH_Drawing_Canvas * , OH_Drawing_Bitmap * ) void OH_Drawing_CanvasBind (OH_Drawing_Canvas * , OH_Drawing_Bitmap * )
``` ```
**Description:** **描述:**
函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染) 函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染)
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| OH_Drawing_Bitmap | 参数为一个指向位图对象的指针 | | OH_Drawing_Bitmap | 参数为一个指向位图对象的指针 |
**自从:**
8
### OH_Drawing_CanvasClear() ### OH_Drawing_CanvasClear()
...@@ -816,19 +950,23 @@ void OH_Drawing_CanvasBind (OH_Drawing_Canvas * , OH_Drawing_Bitmap * ) ...@@ -816,19 +950,23 @@ void OH_Drawing_CanvasBind (OH_Drawing_Canvas * , OH_Drawing_Bitmap * )
void OH_Drawing_CanvasClear (OH_Drawing_Canvas * , uint32_t color ) void OH_Drawing_CanvasClear (OH_Drawing_Canvas * , uint32_t color )
``` ```
**Description:** **描述:**
函数用于使用指定颜色去清空画布 函数用于使用指定颜色去清空画布
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| color | 参数为一个描述颜色的32位(ARGB)变量 | | color | 参数为一个描述颜色的32位(ARGB)变量 |
**自从:**
8
### OH_Drawing_CanvasCreate() ### OH_Drawing_CanvasCreate()
...@@ -837,16 +975,20 @@ void OH_Drawing_CanvasClear (OH_Drawing_Canvas * , uint32_t color ) ...@@ -837,16 +975,20 @@ void OH_Drawing_CanvasClear (OH_Drawing_Canvas * , uint32_t color )
OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void ) OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void )
``` ```
**Description:** **描述:**
函数用于创建一个画布对象 函数用于创建一个画布对象
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
函数会返回一个指针,指针指向创建的画布对象 函数会返回一个指针,指针指向创建的画布对象
**自从:**
8
### OH_Drawing_CanvasDestroy() ### OH_Drawing_CanvasDestroy()
...@@ -855,18 +997,22 @@ OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void ) ...@@ -855,18 +997,22 @@ OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void )
void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas * ) void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas * )
``` ```
**Description:** **描述:**
函数用于销毁画布对象并回收该对象占有的内存 函数用于销毁画布对象并回收该对象占有的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数是一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数是一个指向画布对象的指针 |
**自从:**
8
### OH_Drawing_CanvasDetachBrush() ### OH_Drawing_CanvasDetachBrush()
...@@ -875,18 +1021,22 @@ void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas * ) ...@@ -875,18 +1021,22 @@ void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas * )
void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas * ) void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas * )
``` ```
**Description:** **描述:**
函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状 函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
**自从:**
8
### OH_Drawing_CanvasDetachPen() ### OH_Drawing_CanvasDetachPen()
...@@ -895,18 +1045,22 @@ void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas * ) ...@@ -895,18 +1045,22 @@ void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas * )
void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas * ) void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas * )
``` ```
**Description:** **描述:**
函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓 函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
**自从:**
8
### OH_Drawing_CanvasDrawLine() ### OH_Drawing_CanvasDrawLine()
...@@ -915,15 +1069,15 @@ void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas * ) ...@@ -915,15 +1069,15 @@ void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas * )
void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float x2, float y2 ) void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float x2, float y2 )
``` ```
**Description:** **描述:**
函数用于画一条直线段 函数用于画一条直线段
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| x1 | 参数为线段起始点的横坐标 | | x1 | 参数为线段起始点的横坐标 |
...@@ -931,6 +1085,10 @@ void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float ...@@ -931,6 +1085,10 @@ void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float
| x2 | 参数为线段结束点的横坐标 | | x2 | 参数为线段结束点的横坐标 |
| y2 | 参数为线段结束点的纵坐标 | | y2 | 参数为线段结束点的纵坐标 |
**自从:**
8
### OH_Drawing_CanvasDrawPath() ### OH_Drawing_CanvasDrawPath()
...@@ -939,19 +1097,23 @@ void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float ...@@ -939,19 +1097,23 @@ void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas * , float x1, float y1, float
void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas * , const OH_Drawing_Path * ) void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas * , const OH_Drawing_Path * )
``` ```
**Description:** **描述:**
函数用于画一个自定义路径 函数用于画一个自定义路径
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
**自从:**
8
### OH_Drawing_CanvasRestore() ### OH_Drawing_CanvasRestore()
...@@ -960,18 +1122,22 @@ void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas * , const OH_Drawing_Path * ) ...@@ -960,18 +1122,22 @@ void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas * , const OH_Drawing_Path * )
void OH_Drawing_CanvasRestore (OH_Drawing_Canvas * ) void OH_Drawing_CanvasRestore (OH_Drawing_Canvas * )
``` ```
**Description:** **描述:**
函数用于恢复保存在栈顶的画布状态(画布矩阵) 函数用于恢复保存在栈顶的画布状态(画布矩阵)
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
**自从:**
8
### OH_Drawing_CanvasSave() ### OH_Drawing_CanvasSave()
...@@ -980,18 +1146,22 @@ void OH_Drawing_CanvasRestore (OH_Drawing_Canvas * ) ...@@ -980,18 +1146,22 @@ void OH_Drawing_CanvasRestore (OH_Drawing_Canvas * )
void OH_Drawing_CanvasSave (OH_Drawing_Canvas * ) void OH_Drawing_CanvasSave (OH_Drawing_Canvas * )
``` ```
**Description:** **描述:**
函数用于保存当前画布的状态(画布矩阵)到一个栈顶 函数用于保存当前画布的状态(画布矩阵)到一个栈顶
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Canvas | 参数为一个指向画布对象的指针 | | OH_Drawing_Canvas | 参数为一个指向画布对象的指针 |
**自从:**
8
### OH_Drawing_ColorSetArgb() ### OH_Drawing_ColorSetArgb()
...@@ -1000,25 +1170,29 @@ void OH_Drawing_CanvasSave (OH_Drawing_Canvas * ) ...@@ -1000,25 +1170,29 @@ void OH_Drawing_CanvasSave (OH_Drawing_Canvas * )
uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue ) uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue )
``` ```
**Description:** **描述:**
函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量 函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| alpha | 参数为一个描述透明度的变量,&nbsp;变量范围是0x00~0xFF | | alpha | 参数为一个描述透明度的变量, 变量范围是0x00~0xFF |
| red | 参数为一个描述红色的变量,&nbsp;变量范围是0x00~0xFF | | red | 参数为一个描述红色的变量, 变量范围是0x00~0xFF |
| green | 参数为一个描述绿色的变量,&nbsp;变量范围是0x00~0xFF | | green | 参数为一个描述绿色的变量, 变量范围是0x00~0xFF |
| blue | 参数为一个描述蓝色的变量,&nbsp;变量范围是0x00~0xFF | | blue | 参数为一个描述蓝色的变量, 变量范围是0x00~0xFF |
**Returns:** **返回:**
函数返回一个描述颜色的32位(ARGB)变量 函数返回一个描述颜色的32位(ARGB)变量
**自从:**
8
### OH_Drawing_CreateFontCollection() ### OH_Drawing_CreateFontCollection()
...@@ -1027,16 +1201,20 @@ uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green, ...@@ -1027,16 +1201,20 @@ uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green,
OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void ) OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void )
``` ```
**Description:** **描述:**
创建OH_Drawing_FontCollection 创建OH_Drawing_FontCollection
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
指向创建的OH_Drawing_FontCollection对象的指针 指向创建的OH_Drawing_FontCollection对象的指针
**自从:**
8
### OH_Drawing_CreateTextStyle() ### OH_Drawing_CreateTextStyle()
...@@ -1045,16 +1223,20 @@ OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void ) ...@@ -1045,16 +1223,20 @@ OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void )
OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void ) OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void )
``` ```
**Description:** **描述:**
创建OH_Drawing_TextStyle 创建OH_Drawing_TextStyle
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
指向创建的OH_Drawing_TextStyle对象的指针 指向创建的OH_Drawing_TextStyle对象的指针
**自从:**
8
### OH_Drawing_CreateTypography() ### OH_Drawing_CreateTypography()
...@@ -1063,22 +1245,26 @@ OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void ) ...@@ -1063,22 +1245,26 @@ OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void )
OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate * ) OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate * )
``` ```
**Description:** **描述:**
创建OH_Drawing_Typography 创建OH_Drawing_Typography
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 | | OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 |
**Returns:** **返回:**
指向OH_Drawing_Typography对象的指针 指向OH_Drawing_Typography对象的指针
**自从:**
8
### OH_Drawing_CreateTypographyHandler() ### OH_Drawing_CreateTypographyHandler()
...@@ -1087,23 +1273,27 @@ OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate ...@@ -1087,23 +1273,27 @@ OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate
OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_TypographyStyle * , OH_Drawing_FontCollection * ) OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_TypographyStyle * , OH_Drawing_FontCollection * )
``` ```
**Description:** **描述:**
创建指向OH_Drawing_TypographyCreate对象的指针 创建指向OH_Drawing_TypographyCreate对象的指针
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle的指针 | | OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle的指针 |
| OH_Drawing_FontCollection | 指向OH_Drawing_FontCollection的指针 | | OH_Drawing_FontCollection | 指向OH_Drawing_FontCollection的指针 |
**Returns:** **返回:**
指向新创建的OH_Drawing_TypographyCreate对象的指针 指向新创建的OH_Drawing_TypographyCreate对象的指针
**自从:**
8
### OH_Drawing_CreateTypographyStyle() ### OH_Drawing_CreateTypographyStyle()
...@@ -1112,16 +1302,20 @@ OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_Typo ...@@ -1112,16 +1302,20 @@ OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_Typo
OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void ) OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void )
``` ```
**Description:** **描述:**
创建OH_Drawing_TypographyStyle 创建OH_Drawing_TypographyStyle
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
指向创建的OH_Drawing_TypographyStyle对象的指针 指向创建的OH_Drawing_TypographyStyle对象的指针
**自从:**
8
### OH_Drawing_DestroyFontCollection() ### OH_Drawing_DestroyFontCollection()
...@@ -1130,18 +1324,22 @@ OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void ) ...@@ -1130,18 +1324,22 @@ OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void )
void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection * ) void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection * )
``` ```
**Description:** **描述:**
释放被OH_Drawing_FontCollection对象占据的内存 释放被OH_Drawing_FontCollection对象占据的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_FontCollection | 指向OH_Drawing_FontCollection对象的指针 | | OH_Drawing_FontCollection | 指向OH_Drawing_FontCollection对象的指针 |
**自从:**
8
### OH_Drawing_DestroyTextStyle() ### OH_Drawing_DestroyTextStyle()
...@@ -1150,18 +1348,22 @@ void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection * ) ...@@ -1150,18 +1348,22 @@ void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection * )
void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle * ) void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle * )
``` ```
**Description:** **描述:**
释放被OH_Drawing_TextStyle对象占据的内存 释放被OH_Drawing_TextStyle对象占据的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
**自从:**
8
### OH_Drawing_DestroyTypography() ### OH_Drawing_DestroyTypography()
...@@ -1170,18 +1372,22 @@ void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle * ) ...@@ -1170,18 +1372,22 @@ void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle * )
void OH_Drawing_DestroyTypography (OH_Drawing_Typography * ) void OH_Drawing_DestroyTypography (OH_Drawing_Typography * )
``` ```
**Description:** **描述:**
释放OH_Drawing_Typography对象占据的内存 释放OH_Drawing_Typography对象占据的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 | | OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 |
**自从:**
8
### OH_Drawing_DestroyTypographyHandler() ### OH_Drawing_DestroyTypographyHandler()
...@@ -1190,18 +1396,22 @@ void OH_Drawing_DestroyTypography (OH_Drawing_Typography * ) ...@@ -1190,18 +1396,22 @@ void OH_Drawing_DestroyTypography (OH_Drawing_Typography * )
void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate * ) void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate * )
``` ```
**Description:** **描述:**
释放被OH_Drawing_TypographyCreate对象占据的内存 释放被OH_Drawing_TypographyCreate对象占据的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 | | OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 |
**自从:**
8
### OH_Drawing_DestroyTypographyStyle() ### OH_Drawing_DestroyTypographyStyle()
...@@ -1210,18 +1420,22 @@ void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate * ) ...@@ -1210,18 +1420,22 @@ void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate * )
void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle * ) void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle * )
``` ```
**Description:** **描述:**
释放被OH_Drawing_TypographyStyle对象占据的内存 释放被OH_Drawing_TypographyStyle对象占据的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 | | OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 |
**自从:**
8
### OH_Drawing_PathArcTo() ### OH_Drawing_PathArcTo()
...@@ -1230,15 +1444,15 @@ void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle * ) ...@@ -1230,15 +1444,15 @@ void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle * )
void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, float y2, float startDeg, float sweepDeg ) void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, float y2, float startDeg, float sweepDeg )
``` ```
**Description:** **描述:**
函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆, 然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段 函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆, 然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
| x1 | 参数为包围椭圆的矩形左上角点位置的横坐标 | | x1 | 参数为包围椭圆的矩形左上角点位置的横坐标 |
...@@ -1246,6 +1460,10 @@ void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, flo ...@@ -1246,6 +1460,10 @@ void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, flo
| x2 | 参数为包围椭圆的矩形右下角点位置的横坐标 | | x2 | 参数为包围椭圆的矩形右下角点位置的横坐标 |
| y3 | 参数为包围椭圆的矩形右下角点位置的纵坐标 | | y3 | 参数为包围椭圆的矩形右下角点位置的纵坐标 |
**自从:**
8
### OH_Drawing_PathClose() ### OH_Drawing_PathClose()
...@@ -1254,18 +1472,22 @@ void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, flo ...@@ -1254,18 +1472,22 @@ void OH_Drawing_PathArcTo (OH_Drawing_Path * , float x1, float y1, float x2, flo
void OH_Drawing_PathClose (OH_Drawing_Path * ) void OH_Drawing_PathClose (OH_Drawing_Path * )
``` ```
**Description:** **描述:**
函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段 函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
**自从:**
8
### OH_Drawing_PathCreate() ### OH_Drawing_PathCreate()
...@@ -1274,16 +1496,20 @@ void OH_Drawing_PathClose (OH_Drawing_Path * ) ...@@ -1274,16 +1496,20 @@ void OH_Drawing_PathClose (OH_Drawing_Path * )
OH_Drawing_Path* OH_Drawing_PathCreate (void ) OH_Drawing_Path* OH_Drawing_PathCreate (void )
``` ```
**Description:** **描述:**
函数用于创建一个路径对象 函数用于创建一个路径对象
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
函数会返回一个指针,指针指向创建的路径对象 函数会返回一个指针,指针指向创建的路径对象
**自从:**
8
### OH_Drawing_PathCubicTo() ### OH_Drawing_PathCubicTo()
...@@ -1292,15 +1518,15 @@ OH_Drawing_Path* OH_Drawing_PathCreate (void ) ...@@ -1292,15 +1518,15 @@ OH_Drawing_Path* OH_Drawing_PathCreate (void )
void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY ) void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY )
``` ```
**Description:** **描述:**
函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线 函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
| ctrlX1 | 参数为第一个控制点位置的横坐标 | | ctrlX1 | 参数为第一个控制点位置的横坐标 |
...@@ -1310,6 +1536,10 @@ void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, flo ...@@ -1310,6 +1536,10 @@ void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, flo
| endX | 参数为目标点位置的横坐标 | | endX | 参数为目标点位置的横坐标 |
| endY | 参数为目标点位置的纵坐标 | | endY | 参数为目标点位置的纵坐标 |
**自从:**
8
### OH_Drawing_PathDestroy() ### OH_Drawing_PathDestroy()
...@@ -1318,18 +1548,22 @@ void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, flo ...@@ -1318,18 +1548,22 @@ void OH_Drawing_PathCubicTo (OH_Drawing_Path * , float ctrlX1, float ctrlY1, flo
void OH_Drawing_PathDestroy (OH_Drawing_Path * ) void OH_Drawing_PathDestroy (OH_Drawing_Path * )
``` ```
**Description:** **描述:**
函数用于销毁路径对象并回收该对象占有的内存 函数用于销毁路径对象并回收该对象占有的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
**自从:**
8
### OH_Drawing_PathLineTo() ### OH_Drawing_PathLineTo()
...@@ -1338,20 +1572,24 @@ void OH_Drawing_PathDestroy (OH_Drawing_Path * ) ...@@ -1338,20 +1572,24 @@ void OH_Drawing_PathDestroy (OH_Drawing_Path * )
void OH_Drawing_PathLineTo (OH_Drawing_Path * , float x, float y ) void OH_Drawing_PathLineTo (OH_Drawing_Path * , float x, float y )
``` ```
**Description:** **描述:**
函数用于添加一条从路径的最后点位置到目标点位置的线段 函数用于添加一条从路径的最后点位置到目标点位置的线段
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
| x | 参数为目标点的横坐标 | | x | 参数为目标点的横坐标 |
| y | 参数为目标点的纵坐标 | | y | 参数为目标点的纵坐标 |
**自从:**
8
### OH_Drawing_PathMoveTo() ### OH_Drawing_PathMoveTo()
...@@ -1360,20 +1598,24 @@ void OH_Drawing_PathLineTo (OH_Drawing_Path * , float x, float y ) ...@@ -1360,20 +1598,24 @@ void OH_Drawing_PathLineTo (OH_Drawing_Path * , float x, float y )
void OH_Drawing_PathMoveTo (OH_Drawing_Path * , float x, float y ) void OH_Drawing_PathMoveTo (OH_Drawing_Path * , float x, float y )
``` ```
**Description:** **描述:**
函数用于设置自定义路径的起始点位置 函数用于设置自定义路径的起始点位置
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
| x | 参数为起始点的横坐标 | | x | 参数为起始点的横坐标 |
| y | 参数为起始点的纵坐标 | | y | 参数为起始点的纵坐标 |
**自从:**
8
### OH_Drawing_PathQuadTo() ### OH_Drawing_PathQuadTo()
...@@ -1382,15 +1624,15 @@ void OH_Drawing_PathMoveTo (OH_Drawing_Path * , float x, float y ) ...@@ -1382,15 +1624,15 @@ void OH_Drawing_PathMoveTo (OH_Drawing_Path * , float x, float y )
void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float endX, float endY ) void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float endX, float endY )
``` ```
**Description:** **描述:**
函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线 函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
| ctrlX | 参数为控制点位置的横坐标 | | ctrlX | 参数为控制点位置的横坐标 |
...@@ -1398,6 +1640,10 @@ void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float ...@@ -1398,6 +1640,10 @@ void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float
| endX | 参数为目标点位置的横坐标 | | endX | 参数为目标点位置的横坐标 |
| endY | 参数为目标点位置的纵坐标 | | endY | 参数为目标点位置的纵坐标 |
**自从:**
8
### OH_Drawing_PathReset() ### OH_Drawing_PathReset()
...@@ -1406,18 +1652,22 @@ void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float ...@@ -1406,18 +1652,22 @@ void OH_Drawing_PathQuadTo (OH_Drawing_Path * , float ctrlX, float ctrlY, float
void OH_Drawing_PathReset (OH_Drawing_Path * ) void OH_Drawing_PathReset (OH_Drawing_Path * )
``` ```
**Description:** **描述:**
函数用于重置自定义路径数据 函数用于重置自定义路径数据
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Path | 参数为一个指向路径对象的指针 | | OH_Drawing_Path | 参数为一个指向路径对象的指针 |
**自从:**
8
### OH_Drawing_PenCreate() ### OH_Drawing_PenCreate()
...@@ -1426,16 +1676,20 @@ void OH_Drawing_PathReset (OH_Drawing_Path * ) ...@@ -1426,16 +1676,20 @@ void OH_Drawing_PathReset (OH_Drawing_Path * )
OH_Drawing_Pen* OH_Drawing_PenCreate (void ) OH_Drawing_Pen* OH_Drawing_PenCreate (void )
``` ```
**Description:** **描述:**
函数用于创建一个画笔对象 函数用于创建一个画笔对象
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Returns:** **返回:**
函数会返回一个指针,指针指向创建的画笔对象 函数会返回一个指针,指针指向创建的画笔对象
**自从:**
8
### OH_Drawing_PenDestroy() ### OH_Drawing_PenDestroy()
...@@ -1444,18 +1698,22 @@ OH_Drawing_Pen* OH_Drawing_PenCreate (void ) ...@@ -1444,18 +1698,22 @@ OH_Drawing_Pen* OH_Drawing_PenCreate (void )
void OH_Drawing_PenDestroy (OH_Drawing_Pen * ) void OH_Drawing_PenDestroy (OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于销毁画笔对象并回收该对象占有的内存 函数用于销毁画笔对象并回收该对象占有的内存
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**自从:**
8
### OH_Drawing_PenGetCap() ### OH_Drawing_PenGetCap()
...@@ -1464,22 +1722,26 @@ void OH_Drawing_PenDestroy (OH_Drawing_Pen * ) ...@@ -1464,22 +1722,26 @@ void OH_Drawing_PenDestroy (OH_Drawing_Pen * )
OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen * ) OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取画笔笔帽的样式 函数用于获取画笔笔帽的样式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回画笔笔帽样式 函数返回画笔笔帽样式
**自从:**
8
### OH_Drawing_PenGetColor() ### OH_Drawing_PenGetColor()
...@@ -1488,22 +1750,26 @@ OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen * ) ...@@ -1488,22 +1750,26 @@ OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen * )
uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen * ) uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回一个描述颜色的32位(ARGB)变量 函数返回一个描述颜色的32位(ARGB)变量
**自从:**
8
### OH_Drawing_PenGetJoin() ### OH_Drawing_PenGetJoin()
...@@ -1512,22 +1778,26 @@ uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen * ) ...@@ -1512,22 +1778,26 @@ uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen * )
OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen * ) OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取画笔绘制折线转角的样式 函数用于获取画笔绘制折线转角的样式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回折线转角的样式 函数返回折线转角的样式
**自从:**
8
### OH_Drawing_PenGetMiterLimit() ### OH_Drawing_PenGetMiterLimit()
...@@ -1536,22 +1806,26 @@ OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen * ) ...@@ -1536,22 +1806,26 @@ OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen * )
float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen * ) float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回尖角的限制值 函数返回尖角的限制值
**自从:**
8
### OH_Drawing_PenGetWidth() ### OH_Drawing_PenGetWidth()
...@@ -1560,22 +1834,26 @@ float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen * ) ...@@ -1560,22 +1834,26 @@ float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen * )
float OH_Drawing_PenGetWidth (const OH_Drawing_Pen * ) float OH_Drawing_PenGetWidth (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回画笔的厚度 函数返回画笔的厚度
**自从:**
8
### OH_Drawing_PenIsAntiAlias() ### OH_Drawing_PenIsAntiAlias()
...@@ -1584,22 +1862,26 @@ float OH_Drawing_PenGetWidth (const OH_Drawing_Pen * ) ...@@ -1584,22 +1862,26 @@ float OH_Drawing_PenGetWidth (const OH_Drawing_Pen * )
bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen * ) bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen * )
``` ```
**Description:** **描述:**
函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
**Returns:** **返回:**
函数返回画笔对象是否设置抗锯齿属性,返回真则设置了抗锯齿,返回假则没有设置抗锯齿 函数返回画笔对象是否设置抗锯齿属性,返回真则设置了抗锯齿,返回假则没有设置抗锯齿
**自从:**
8
### OH_Drawing_PenSetAntiAlias() ### OH_Drawing_PenSetAntiAlias()
...@@ -1608,19 +1890,23 @@ bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen * ) ...@@ -1608,19 +1890,23 @@ bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen * )
void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen * , bool ) void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen * , bool )
``` ```
**Description:** **描述:**
函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理 函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| bool | 参数真为抗锯齿,参数假则不做抗锯齿处理 | | bool | 参数真为抗锯齿,参数假则不做抗锯齿处理 |
**自从:**
8
### OH_Drawing_PenSetCap() ### OH_Drawing_PenSetCap()
...@@ -1629,19 +1915,23 @@ void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen * , bool ) ...@@ -1629,19 +1915,23 @@ void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen * , bool )
void OH_Drawing_PenSetCap (OH_Drawing_Pen * , OH_Drawing_PenLineCapStyle ) void OH_Drawing_PenSetCap (OH_Drawing_Pen * , OH_Drawing_PenLineCapStyle )
``` ```
**Description:** **描述:**
函数用于设置画笔笔帽样式 函数用于设置画笔笔帽样式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| OH_Drawing_PenLineCapStyle | 参数是一个描述画笔笔帽样式的变量 | | OH_Drawing_PenLineCapStyle | 参数是一个描述画笔笔帽样式的变量 |
**自从:**
8
### OH_Drawing_PenSetColor() ### OH_Drawing_PenSetColor()
...@@ -1650,19 +1940,23 @@ void OH_Drawing_PenSetCap (OH_Drawing_Pen * , OH_Drawing_PenLineCapStyle ) ...@@ -1650,19 +1940,23 @@ void OH_Drawing_PenSetCap (OH_Drawing_Pen * , OH_Drawing_PenLineCapStyle )
void OH_Drawing_PenSetColor (OH_Drawing_Pen * , uint32_t color ) void OH_Drawing_PenSetColor (OH_Drawing_Pen * , uint32_t color )
``` ```
**Description:** **描述:**
函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| color | 参数是一个描述颜色的32位(ARGB)变量 | | color | 参数是一个描述颜色的32位(ARGB)变量 |
**自从:**
8
### OH_Drawing_PenSetJoin() ### OH_Drawing_PenSetJoin()
...@@ -1671,19 +1965,23 @@ void OH_Drawing_PenSetColor (OH_Drawing_Pen * , uint32_t color ) ...@@ -1671,19 +1965,23 @@ void OH_Drawing_PenSetColor (OH_Drawing_Pen * , uint32_t color )
void OH_Drawing_PenSetJoin (OH_Drawing_Pen * , OH_Drawing_PenLineJoinStyle ) void OH_Drawing_PenSetJoin (OH_Drawing_Pen * , OH_Drawing_PenLineJoinStyle )
``` ```
**Description:** **描述:**
函数用于设置画笔绘制转角的样式 函数用于设置画笔绘制转角的样式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| OH_Drawing_PenLineJoinStyle | 参数值一个描述折线转角样式的变量 | | OH_Drawing_PenLineJoinStyle | 参数值一个描述折线转角样式的变量 |
**自从:**
8
### OH_Drawing_PenSetMiterLimit() ### OH_Drawing_PenSetMiterLimit()
...@@ -1692,19 +1990,23 @@ void OH_Drawing_PenSetJoin (OH_Drawing_Pen * , OH_Drawing_PenLineJoinStyle ) ...@@ -1692,19 +1990,23 @@ void OH_Drawing_PenSetJoin (OH_Drawing_Pen * , OH_Drawing_PenLineJoinStyle )
void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen * , float miter ) void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen * , float miter )
``` ```
**Description:** **描述:**
函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| miter | 参数是一个描述尖角限制值的变量 | | miter | 参数是一个描述尖角限制值的变量 |
**自从:**
8
### OH_Drawing_PenSetWidth() ### OH_Drawing_PenSetWidth()
...@@ -1713,19 +2015,23 @@ void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen * , float miter ) ...@@ -1713,19 +2015,23 @@ void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen * , float miter )
void OH_Drawing_PenSetWidth (OH_Drawing_Pen * , float width ) void OH_Drawing_PenSetWidth (OH_Drawing_Pen * , float width )
``` ```
**Description:** **描述:**
函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Pen | 参数是一个指向画笔对象的指针 | | OH_Drawing_Pen | 参数是一个指向画笔对象的指针 |
| width | 参数是一个描述画笔厚度的变量 | | width | 参数是一个描述画笔厚度的变量 |
**自从:**
8
### OH_Drawing_SetTextStyleBaseLine() ### OH_Drawing_SetTextStyleBaseLine()
...@@ -1734,19 +2040,23 @@ void OH_Drawing_PenSetWidth (OH_Drawing_Pen * , float width ) ...@@ -1734,19 +2040,23 @@ void OH_Drawing_PenSetWidth (OH_Drawing_Pen * , float width )
void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle * , int ) void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle * , int )
``` ```
**Description:** **描述:**
设置字体基线位置 设置字体基线位置
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| int | OH_Drawing_TextBaseline枚举类型 | | int | OH_Drawing_TextBaseline枚举类型 |
**自从:**
8
### OH_Drawing_SetTextStyleColor() ### OH_Drawing_SetTextStyleColor()
...@@ -1755,19 +2065,23 @@ void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle * , int ) ...@@ -1755,19 +2065,23 @@ void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle * , int )
void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle * , uint32_t ) void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle * , uint32_t )
``` ```
**Description:** **描述:**
设置文本颜色 设置文本颜色
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| uint32_t | 颜色 | | uint32_t | 颜色 |
**自从:**
8
### OH_Drawing_SetTextStyleDecoration() ### OH_Drawing_SetTextStyleDecoration()
...@@ -1776,19 +2090,23 @@ void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle * , uint32_t ) ...@@ -1776,19 +2090,23 @@ void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle * , uint32_t )
void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle * , int ) void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle * , int )
``` ```
**Description:** **描述:**
设置装饰 设置装饰
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| int | OH_Drawing_TextDecoration枚举类型 | | int | OH_Drawing_TextDecoration枚举类型 |
**自从:**
8
### OH_Drawing_SetTextStyleDecorationColor() ### OH_Drawing_SetTextStyleDecorationColor()
...@@ -1797,19 +2115,23 @@ void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle * , int ) ...@@ -1797,19 +2115,23 @@ void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle * , int )
void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle * , uint32_t ) void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle * , uint32_t )
``` ```
**Description:** **描述:**
设置装饰颜色 设置装饰颜色
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| uint32_t | 颜色 | | uint32_t | 颜色 |
**自从:**
8
### OH_Drawing_SetTextStyleFontFamilies() ### OH_Drawing_SetTextStyleFontFamilies()
...@@ -1818,20 +2140,24 @@ void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle * , uint32_t ...@@ -1818,20 +2140,24 @@ void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle * , uint32_t
void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle * , int , const char * fontFamilies[] ) void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle * , int , const char * fontFamilies[] )
``` ```
**Description:** **描述:**
设置字体类型 设置字体类型
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| int | 字体名称数量 | | int | 字体名称数量 |
| char | 指向字体类型的指针 | | char | 指向字体类型的指针 |
**自从:**
8
### OH_Drawing_SetTextStyleFontHeight() ### OH_Drawing_SetTextStyleFontHeight()
...@@ -1840,19 +2166,23 @@ void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle * , int , const c ...@@ -1840,19 +2166,23 @@ void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle * , int , const c
void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle * , double ) void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle * , double )
``` ```
**Description:** **描述:**
设置字体高度 设置字体高度
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| double | 字体高度 | | double | 字体高度 |
**自从:**
8
### OH_Drawing_SetTextStyleFontSize() ### OH_Drawing_SetTextStyleFontSize()
...@@ -1861,19 +2191,23 @@ void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle * , double ) ...@@ -1861,19 +2191,23 @@ void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle * , double )
void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle * , double ) void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle * , double )
``` ```
**Description:** **描述:**
设置字号 设置字号
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| double | 字号 | | double | 字号 |
**自从:**
8
### OH_Drawing_SetTextStyleFontStyle() ### OH_Drawing_SetTextStyleFontStyle()
...@@ -1882,19 +2216,23 @@ void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle * , double ) ...@@ -1882,19 +2216,23 @@ void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle * , double )
void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle * , int ) void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle * , int )
``` ```
**Description:** **描述:**
设置字体风格 设置字体风格
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| int | OH_Drawing_FontStyle枚举类型 | | int | OH_Drawing_FontStyle枚举类型 |
**自从:**
8
### OH_Drawing_SetTextStyleFontWeight() ### OH_Drawing_SetTextStyleFontWeight()
...@@ -1903,19 +2241,23 @@ void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle * , int ) ...@@ -1903,19 +2241,23 @@ void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle * , int )
void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle * , int ) void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle * , int )
``` ```
**Description:** **描述:**
设置字重 设置字重
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| int | OH_Drawing_FontWeight枚举类型 | | int | OH_Drawing_FontWeight枚举类型 |
**自从:**
8
### OH_Drawing_SetTextStyleLocale() ### OH_Drawing_SetTextStyleLocale()
...@@ -1924,19 +2266,23 @@ void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle * , int ) ...@@ -1924,19 +2266,23 @@ void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle * , int )
void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle * , const char * ) void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle * , const char * )
``` ```
**Description:** **描述:**
设置语言区域 设置语言区域
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
| char | 语言区域,数据类型为指向char的指针 | | char | 语言区域,数据类型为指向char的指针 |
**自从:**
8
### OH_Drawing_SetTypographyTextAlign() ### OH_Drawing_SetTypographyTextAlign()
...@@ -1945,19 +2291,23 @@ void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle * , const char * ) ...@@ -1945,19 +2291,23 @@ void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle * , const char * )
void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle * , int ) void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle * , int )
``` ```
**Description:** **描述:**
设置文本对齐方式 设置文本对齐方式
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 | | OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 |
| int | OH_Drawing_TextAlign枚举类型 | | int | OH_Drawing_TextAlign枚举类型 |
**自从:**
8
### OH_Drawing_SetTypographyTextDirection() ### OH_Drawing_SetTypographyTextDirection()
...@@ -1966,19 +2316,23 @@ void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle * , int ) ...@@ -1966,19 +2316,23 @@ void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle * , int )
void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle * , int ) void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle * , int )
``` ```
**Description:** **描述:**
设置文本方向 设置文本方向
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 | | OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 |
| int | OH_Drawing_TextDirection枚举类型 | | int | OH_Drawing_TextDirection枚举类型 |
**自从:**
8
### OH_Drawing_SetTypographyTextMaxLines() ### OH_Drawing_SetTypographyTextMaxLines()
...@@ -1987,19 +2341,23 @@ void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle * , int ...@@ -1987,19 +2341,23 @@ void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle * , int
void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle * , int ) void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle * , int )
``` ```
**Description:** **描述:**
设置文本最大行数 设置文本最大行数
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 | | OH_Drawing_TypographyStyle | 指向OH_Drawing_TypographyStyle对象的指针 |
| int | 最大行数 | | int | 最大行数 |
**自从:**
8
### OH_Drawing_TypographyHandlerAddText() ### OH_Drawing_TypographyHandlerAddText()
...@@ -2008,60 +2366,72 @@ void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle * , int ) ...@@ -2008,60 +2366,72 @@ void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle * , int )
void OH_Drawing_TypographyHandlerAddText (OH_Drawing_TypographyCreate * , const char * ) void OH_Drawing_TypographyHandlerAddText (OH_Drawing_TypographyCreate * , const char * )
``` ```
**Description:** **描述:**
设置文本内容 设置文本内容
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 | | OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 |
| char | 指向文本内容的指针 | | char | 指向文本内容的指针 |
**自从:**
8
### OH_Drawing_TypographyHandlerPop()
### OH_Drawing_TypographyHandlerPopTextStyle()
``` ```
void OH_Drawing_TypographyHandlerPop (OH_Drawing_TypographyCreate * ) void OH_Drawing_TypographyHandlerPopTextStyle (OH_Drawing_TypographyCreate * )
``` ```
**Description:** **描述:**
排版弹出 排版弹出
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 | | OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 |
**自从:**
8
### OH_Drawing_TypographyHandlerPushStyle() ### OH_Drawing_TypographyHandlerPushTextStyle()
``` ```
void OH_Drawing_TypographyHandlerPushStyle (OH_Drawing_TypographyCreate * , OH_Drawing_TextStyle * ) void OH_Drawing_TypographyHandlerPushTextStyle (OH_Drawing_TypographyCreate * , OH_Drawing_TextStyle * )
``` ```
**Description:** **描述:**
设置排版风格 设置排版风格
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 | | OH_Drawing_TypographyCreate | 指向OH_Drawing_TypographyCreate对象的指针 |
| OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 | | OH_Drawing_TextStyle | 指向OH_Drawing_TextStyle对象的指针 |
**自从:**
8
### OH_Drawing_TypographyLayout() ### OH_Drawing_TypographyLayout()
...@@ -2070,19 +2440,23 @@ void OH_Drawing_TypographyHandlerPushStyle (OH_Drawing_TypographyCreate * , OH_D ...@@ -2070,19 +2440,23 @@ void OH_Drawing_TypographyHandlerPushStyle (OH_Drawing_TypographyCreate * , OH_D
void OH_Drawing_TypographyLayout (OH_Drawing_Typography * , double ) void OH_Drawing_TypographyLayout (OH_Drawing_Typography * , double )
``` ```
**Description:** **描述:**
排版布局 排版布局
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 | | OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 |
| double | 文本最大宽度 | | double | 文本最大宽度 |
**自从:**
8
### OH_Drawing_TypographyPaint() ### OH_Drawing_TypographyPaint()
...@@ -2091,17 +2465,21 @@ void OH_Drawing_TypographyLayout (OH_Drawing_Typography * , double ) ...@@ -2091,17 +2465,21 @@ void OH_Drawing_TypographyLayout (OH_Drawing_Typography * , double )
void OH_Drawing_TypographyPaint (OH_Drawing_Typography * , OH_Drawing_Canvas * , double , double ) void OH_Drawing_TypographyPaint (OH_Drawing_Typography * , OH_Drawing_Canvas * , double , double )
``` ```
**Description:** **描述:**
显示文本 显示文本
\@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 | | OH_Drawing_Typography | 指向OH_Drawing_Typography对象的指针 |
| OH_Drawing_Canvas | 指向OH_Drawing_Canvas对象的指针 | | OH_Drawing_Canvas | 指向OH_Drawing_Canvas对象的指针 |
| double | x坐标 | | double | x坐标 |
| double | y坐标 | | double | y坐标 |
**自从:**
8
# HiLog # HiLog
## **Overview**
**Description:**
HiLog模块实现日志打印功能。 HiLog模块实现日志打印功能。
开发者可以通过使用这些接口实现日志相关功能,输出日志时可以指定日志类型、所属业务领域、日志TAG标识、日志级别等。 开发者可以通过使用这些接口实现日志相关功能,输出日志时可以指定日志类型、所属业务领域、日志TAG标识、日志级别等。
\@syscap SystemCapability.HiviewDFX.HiLog
**Since:** @syscap SystemCapability.HiviewDFX.HiLog
**自从:**
8 8
## **Summary** ## 汇总
### Files ### 文件
| File&nbsp;Name | Description | | 文件名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [log.h](log_8h.md) | HiLog模块日志接口定义,通过这些接口实现日志打印相关功能。 | | [log.h](log_8h.md) | HiLog模块日志接口定义,通过这些接口实现日志打印相关功能。 |
### Macros ### 宏定义
| Macro&nbsp;Name&nbsp;and&nbsp;Value | Description | | 宏定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| LOG_DOMAIN&nbsp;&nbsp;&nbsp;0 | 日志所对应的业务领域,用于标识业务的子系统、模块。 | | [LOG_DOMAIN](#log_domain) 0 | 日志所对应的业务领域,用于标识业务的子系统、模块。 |
| LOG_TAG&nbsp;&nbsp;&nbsp;NULL | 字符串常量,标识调用所在的类或者业务。 | | [LOG_TAG](#log_tag) NULL | 字符串常量,标识调用所在的类或者业务。 |
| OH_LOG_DEBUG(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)OH_LOG_Print((type),&nbsp;LOG_DEBUG,&nbsp;LOG_DOMAIN,&nbsp;LOG_TAG,&nbsp;__VA_ARGS__)) | DEBUG级别写日志,宏封装接口。 | | [OH_LOG_DEBUG](#oh_log_debug)(type, ...) ((void)[OH_LOG_Print](#oh_log_print)((type), LOG_DEBUG, LOG_DOMAIN, LOG_TAG, \__VA_ARGS__)) | DEBUG级别写日志,宏封装接口。 |
| OH_LOG_INFO(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)OH_LOG_Print((type),&nbsp;LOG_INFO,&nbsp;LOG_DOMAIN,&nbsp;LOG_TAG,&nbsp;__VA_ARGS__)) | INFO级别写日志,宏封装接口。 | | [OH_LOG_INFO](#oh_log_info)(type, ...) ((void)[OH_LOG_Print](#oh_log_print)((type), LOG_INFO, LOG_DOMAIN, LOG_TAG, \__VA_ARGS__)) | INFO级别写日志,宏封装接口。 |
| OH_LOG_WARN(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)OH_LOG_Print((type),&nbsp;LOG_WARN,&nbsp;LOG_DOMAIN,&nbsp;LOG_TAG,&nbsp;__VA_ARGS__)) | WARN级别写日志,宏封装接口。 | | [OH_LOG_WARN](#oh_log_warn)(type, ...) ((void)[OH_LOG_Print](#oh_log_print)((type), LOG_WARN, LOG_DOMAIN, LOG_TAG, \__VA_ARGS__)) | WARN级别写日志,宏封装接口。 |
| OH_LOG_ERROR(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)OH_LOG_Print((type),&nbsp;LOG_ERROR,&nbsp;LOG_DOMAIN,&nbsp;LOG_TAG,&nbsp;__VA_ARGS__)) | ERROR级别写日志,宏封装接口。 | | [OH_LOG_ERROR](#oh_log_error)(type, ...) ((void)[OH_LOG_Print](#oh_log_print)((type), LOG_ERROR, LOG_DOMAIN, LOG_TAG, \__VA_ARGS__)) | ERROR级别写日志,宏封装接口。 |
| OH_LOG_FATAL(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)HiLogPrint((type),&nbsp;LOG_FATAL,&nbsp;LOG_DOMAIN,&nbsp;LOG_TAG,&nbsp;__VA_ARGS__)) | FATAL级别写日志,宏封装接口。 | | [OH_LOG_FATAL](#oh_log_fatal)(type, ...) ((void)HiLogPrint((type), LOG_FATAL, LOG_DOMAIN, LOG_TAG, \__VA_ARGS__)) | FATAL级别写日志,宏封装接口。 |
### Enumerations ### 枚举
| Enumeration&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| LogType&nbsp;{&nbsp;LOG_APP&nbsp;=&nbsp;0&nbsp;} | 日志类型。 | | [LogType](#logtype) { LOG_APP= 0 } | 日志类型。 |
| LogLevel&nbsp;{&nbsp;&nbsp;&nbsp;LOG_DEBUG&nbsp;=&nbsp;3,&nbsp;LOG_INFO&nbsp;=&nbsp;4,&nbsp;LOG_WARN&nbsp;=&nbsp;5,&nbsp;LOG_ERROR&nbsp;=&nbsp;6,&nbsp;&nbsp;&nbsp;LOG_FATAL&nbsp;=&nbsp;7&nbsp;} | 日志级别。 | | [LogLevel](#loglevel) { LOG_DEBUG = 3, LOG_INFO = 4, LOG_WARN = 5, LOG_ERROR = 6, LOG_FATAL =7 } | 日志级别。 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_LOG_Print&nbsp;(LogType&nbsp;type,&nbsp;LogLevel&nbsp;level,&nbsp;unsigned&nbsp;int&nbsp;domain,&nbsp;const&nbsp;char&nbsp;\*tag,&nbsp;const&nbsp;char&nbsp;\*fmt,...)&nbsp;__attribute__((__format__(os_log | int<br/>写日志接口。 | | [OH_LOG_Print](#oh_log_print) ([LogType](#logtype) type, [LogLevel](#loglevel) level, unsigned int domain, const char \*tag, const char \*fmt,...) \_\_attribute\_\_((\_\_format\_\_(os\_log | 写日志接口。 |
| OH_LOG_IsLoggable&nbsp;(unsigned&nbsp;int&nbsp;domain,&nbsp;const&nbsp;char&nbsp;\*tag,&nbsp;LogLevel&nbsp;level) | int&nbsp;bool<br/>检查指定业务领域、TAG、级别的日志是否可以打印。 | | [OH_LOG_IsLoggable](#oh_log_isloggable) (unsigned int domain, const char \*tag, [LogLevel](#loglevel) level) | 检查指定业务领域、TAG、级别的日志是否可以打印。 |
## **Details** ## 详细描述
## **Macro Definition** ## 宏定义说明
### LOG_DOMAIN ### LOG_DOMAIN
...@@ -68,12 +68,16 @@ HiLog模块实现日志打印功能。 ...@@ -68,12 +68,16 @@ HiLog模块实现日志打印功能。
#define LOG_DOMAIN 0 #define LOG_DOMAIN 0
``` ```
**Description:** **描述:**
日志所对应的业务领域,用于标识业务的子系统、模块。 日志所对应的业务领域,用于标识业务的子系统、模块。
16进制整数,有效范围0x0~0xFFFF,超过自动截掉高位。 16进制整数,有效范围0x0~0xFFFF,超过自动截掉高位。
**自从:**
8
### LOG_TAG ### LOG_TAG
...@@ -82,10 +86,14 @@ HiLog模块实现日志打印功能。 ...@@ -82,10 +86,14 @@ HiLog模块实现日志打印功能。
#define LOG_TAG NULL #define LOG_TAG NULL
``` ```
**Description:** **描述:**
字符串常量,标识调用所在的类或者业务。 字符串常量,标识调用所在的类或者业务。
**自从:**
8
### OH_LOG_DEBUG ### OH_LOG_DEBUG
...@@ -94,24 +102,28 @@ HiLog模块实现日志打印功能。 ...@@ -94,24 +102,28 @@ HiLog模块实现日志打印功能。
#define OH_LOG_DEBUG( type, ... ) ((void)OH_LOG_Print((type), LOG_DEBUG, LOG_DOMAIN, LOG_TAG, __VA_ARGS__)) #define OH_LOG_DEBUG( type, ... ) ((void)OH_LOG_Print((type), LOG_DEBUG, LOG_DOMAIN, LOG_TAG, __VA_ARGS__))
``` ```
**Description:** **描述:**
DEBUG级别写日志,宏封装接口。 DEBUG级别写日志,宏封装接口。
使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。 使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**See also:** **参见:**
[OH_LOG_Print](#oh_log_print) [OH_LOG_Print](#oh_log_print)
**自从:**
8
### OH_LOG_ERROR ### OH_LOG_ERROR
...@@ -120,24 +132,28 @@ DEBUG级别写日志,宏封装接口。 ...@@ -120,24 +132,28 @@ DEBUG级别写日志,宏封装接口。
#define OH_LOG_ERROR( type, ... ) ((void)OH_LOG_Print((type), LOG_ERROR, LOG_DOMAIN, LOG_TAG, __VA_ARGS__)) #define OH_LOG_ERROR( type, ... ) ((void)OH_LOG_Print((type), LOG_ERROR, LOG_DOMAIN, LOG_TAG, __VA_ARGS__))
``` ```
**Description:** **描述:**
ERROR级别写日志,宏封装接口。 ERROR级别写日志,宏封装接口。
使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。 使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**See also:** **参见:**
[OH_LOG_Print](#oh_log_print) [OH_LOG_Print](#oh_log_print)
**自从:**
8
### OH_LOG_FATAL ### OH_LOG_FATAL
...@@ -146,24 +162,28 @@ ERROR级别写日志,宏封装接口。 ...@@ -146,24 +162,28 @@ ERROR级别写日志,宏封装接口。
#define OH_LOG_FATAL( type, ... ) ((void)HiLogPrint((type), LOG_FATAL, LOG_DOMAIN, LOG_TAG, __VA_ARGS__)) #define OH_LOG_FATAL( type, ... ) ((void)HiLogPrint((type), LOG_FATAL, LOG_DOMAIN, LOG_TAG, __VA_ARGS__))
``` ```
**Description:** **描述:**
FATAL级别写日志,宏封装接口。 FATAL级别写日志,宏封装接口。
使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。 使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**See also:** **参见:**
[OH_LOG_Print](#oh_log_print) [OH_LOG_Print](#oh_log_print)
**自从:**
8
### OH_LOG_INFO ### OH_LOG_INFO
...@@ -172,24 +192,29 @@ FATAL级别写日志,宏封装接口。 ...@@ -172,24 +192,29 @@ FATAL级别写日志,宏封装接口。
#define OH_LOG_INFO( type, ... ) ((void)OH_LOG_Print((type), LOG_INFO, LOG_DOMAIN, LOG_TAG, __VA_ARGS__)) #define OH_LOG_INFO( type, ... ) ((void)OH_LOG_Print((type), LOG_INFO, LOG_DOMAIN, LOG_TAG, __VA_ARGS__))
``` ```
**Description:** **描述:**
INFO级别写日志,宏封装接口。 INFO级别写日志,宏封装接口。
使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。 使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**See also:** **参见:**
[OH_LOG_Print](#oh_log_print) [OH_LOG_Print](#oh_log_print)
**自从:**
8
### OH_LOG_WARN ### OH_LOG_WARN
...@@ -197,26 +222,30 @@ INFO级别写日志,宏封装接口。 ...@@ -197,26 +222,30 @@ INFO级别写日志,宏封装接口。
#define OH_LOG_WARN( type, ... ) ((void)OH_LOG_Print((type), LOG_WARN, LOG_DOMAIN, LOG_TAG, __VA_ARGS__)) #define OH_LOG_WARN( type, ... ) ((void)OH_LOG_Print((type), LOG_WARN, LOG_DOMAIN, LOG_TAG, __VA_ARGS__))
``` ```
**Description:** **描述:**
WARN级别写日志,宏封装接口。 WARN级别写日志,宏封装接口。
使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。 使用时需要先定义日志业务领域、日志TAG,一般在源文件起始处统一定义一次。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**See also:** **参见:**
[OH_LOG_Print](#oh_log_print) [OH_LOG_Print](#oh_log_print)
**自从:**
## **Enumeration Type** 8
## 枚举类型说明
### LogLevel ### LogLevel
...@@ -226,7 +255,7 @@ WARN级别写日志,宏封装接口。 ...@@ -226,7 +255,7 @@ WARN级别写日志,宏封装接口。
enum LogLevel enum LogLevel
``` ```
**Description:** **描述:**
日志级别。 日志级别。
...@@ -244,7 +273,7 @@ ERROR:程序或功能发生了错误,该错误会影响功能的正常运行 ...@@ -244,7 +273,7 @@ ERROR:程序或功能发生了错误,该错误会影响功能的正常运行
FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢复。 FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢复。
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| LOG_DEBUG | DEBUG日志级别,使用OH_LOG_DEBUG接口打印 | | LOG_DEBUG | DEBUG日志级别,使用OH_LOG_DEBUG接口打印 |
| LOG_INFO | INFO日志级别,使用OH_LOG_INFO接口打印 | | LOG_INFO | INFO日志级别,使用OH_LOG_INFO接口打印 |
...@@ -252,6 +281,10 @@ FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢 ...@@ -252,6 +281,10 @@ FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢
| LOG_ERROR | ERROR日志级别,使用OH_LOG_ERROR接口打印 | | LOG_ERROR | ERROR日志级别,使用OH_LOG_ERROR接口打印 |
| LOG_FATAL | FATAL日志级别,使用OH_LOG_FATAL接口打印 | | LOG_FATAL | FATAL日志级别,使用OH_LOG_FATAL接口打印 |
**自从:**
8
### LogType ### LogType
...@@ -260,18 +293,22 @@ FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢 ...@@ -260,18 +293,22 @@ FATAL:重大致命异常,表明程序或功能即将崩溃,故障无法恢
enum LogType enum LogType
``` ```
**Description:** **描述:**
日志类型。 日志类型。
该枚举类型用于定义应用开发者可以使用的日志类型。当前有应用日志LOG_APP。 该枚举类型用于定义应用开发者可以使用的日志类型。当前有应用日志LOG_APP。
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| LOG_APP | 应用日志 | | LOG_APP | 应用日志 |
**自从:**
8
## **Function**
## 函数说明
### OH_LOG_IsLoggable() ### OH_LOG_IsLoggable()
...@@ -281,22 +318,26 @@ enum LogType ...@@ -281,22 +318,26 @@ enum LogType
int bool OH_LOG_IsLoggable (unsigned int domain, const char * tag, LogLevel level ) int bool OH_LOG_IsLoggable (unsigned int domain, const char * tag, LogLevel level )
``` ```
**Description:** **描述:**
检查指定业务领域、TAG、级别的日志是否可以打印。 检查指定业务领域、TAG、级别的日志是否可以打印。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| domain | 指定日志业务领域。 | | domain | 指定日志业务领域。 |
| tag | 指定日志TAG。 | | tag | 指定日志TAG。 |
| level | 指定日志level。 | | level | 指定日志level。 |
**Returns:** **返回:**
如果指定domain、tag、level日志可以打印则返回true;否则返回false。 如果指定domain、tag、level日志可以打印则返回true;否则返回false。
**自从:**
8
### OH_LOG_Print() ### OH_LOG_Print()
...@@ -305,15 +346,15 @@ int bool OH_LOG_IsLoggable (unsigned int domain, const char * tag, LogLevel leve ...@@ -305,15 +346,15 @@ int bool OH_LOG_IsLoggable (unsigned int domain, const char * tag, LogLevel leve
int OH_LOG_Print (LogType type, LogLevel level, unsigned int domain, const char * tag, const char * fmt, ... ) int OH_LOG_Print (LogType type, LogLevel level, unsigned int domain, const char * tag, const char * fmt, ... )
``` ```
**Description:** **描述:**
写日志接口。 写日志接口。
指定日志类型、日志级别、业务领域、TAG,按照类printf格式类型和隐私指示确定需要输出的变参。 指定日志类型、日志级别、业务领域、TAG,按照类printf格式类型和隐私指示确定需要输出的变参。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| type | 日志类型,三方应用日志类型为LOG_APP。 | | type | 日志类型,三方应用日志类型为LOG_APP。 |
| level | 日志级别,日志级别包括LOG_DEBUG、LOG_INFO、LOG_WARN、LOG_ERROR、LOG_FATAL。 | | level | 日志级别,日志级别包括LOG_DEBUG、LOG_INFO、LOG_WARN、LOG_ERROR、LOG_FATAL。 |
...@@ -322,6 +363,10 @@ int OH_LOG_Print (LogType type, LogLevel level, unsigned int domain, const char ...@@ -322,6 +363,10 @@ int OH_LOG_Print (LogType type, LogLevel level, unsigned int domain, const char
| fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 | | fmt | 格式化字符串,基于类printf格式的增强,支持隐私参数标识,即在格式字符串每个参数中符号后类型前增加{public}、{private}标识。 |
| ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 | | ... | 与格式字符串里参数类型对应的参数列表,参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**Returns:** **返回:**
大于等于0表示成功;小于0表示失败。 大于等于0表示成功;小于0表示失败。
**自从:**
8
# Native_Bundle
## **Overview**
**Description:**
Describes the Native Bundle.
**Since:**
9
**Version:**
1.0
## **Summary**
### Files
| File&nbsp;Name | Description |
| -------- | -------- |
| [native_interface_bundle.h](native__interface__bundle_8h.md) | Declares&nbsp;the&nbsp;**Bundle**-specific&nbsp;function,&nbsp;including&nbsp;function&nbsp;for&nbsp;obtaining&nbsp;application&nbsp;ID. |
### Functions
| Function | Description |
| -------- | -------- |
| OH_NativeBundle_GetAppIdByBundleName&nbsp;(const&nbsp;char&nbsp;\*bundleName) | char&nbsp;\*<br/>Obtains&nbsp;the&nbsp;application&nbsp;ID&nbsp;based&nbsp;on&nbsp;the&nbsp;given&nbsp;bundle&nbsp;name. |
## **Details**
## **Function**
### OH_NativeBundle_GetAppIdByBundleName()
```
char* OH_NativeBundle_GetAppIdByBundleName (const char * bundleName)
```
**Description:**
Obtains the application ID based on the given bundle name.
**Parameters:**
| Name | Description |
| -------- | -------- |
| bundleName | Indicates&nbsp;the&nbsp;bundle&nbsp;name&nbsp;of&nbsp;the&nbsp;application. |
**Returns:**
Returns the application ID pointer if successfully obtained and needs to be freed; returns nullptr otherwise.
# NativeVsync
提供NativeVsync功能。
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**自从:**
8
## 汇总
### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [native_vsync.h](native__vsync_8h.md) | 定义获取和使用NativeVsync的相关函数 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeVSync_Create](#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
| [OH_NativeVSync_Destroy](#oh_nativevsync_destroy) (OH_NativeVSync \*nativeVsync) | 销毁OH_NativeVSync实例 |
| [OH_NativeVSync_RequestFrame](#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
## 详细描述
## 函数说明
### OH_NativeVSync_Create()
```
OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length )
```
**描述:**
创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| Name | 描述 |
| -------- | -------- |
| name | 参数表示一个vsync连接的名字 |
| length | 参数是name的长度 |
**返回:**
返回一个指向OH_NativeVSync实例的指针
**自从:**
8
### OH_NativeVSync_Destroy()
```
void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync)
```
**描述:**
销毁OH_NativeVSync实例
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| Name | 描述 |
| -------- | -------- |
| nativeVsync | 参数是一个指向OH_NativeVSync实例的指针 |
**自从:**
8
### OH_NativeVSync_RequestFrame()
```
int OH_NativeVSync_RequestFrame (OH_NativeVSync * nativeVsync, OH_NativeVSync_FrameCallback callback, void * data )
```
**描述:**
请求下一次vsync信号,当信号到来时,调用回调函数callback
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| Name | 描述 |
| -------- | -------- |
| nativeVsync | 参数是一个指向OH_NativeVSync实例的指针 |
| callback | 参数是一个OH_NativeVSync_FrameCallback类型的函数指针,当下一次vsync信号到来时会被调用 |
| data | 参数是一个指向用户自定义数据结构的指针,类型是void\* |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**自从:**
8
# NativeWindow # NativeWindow
## **Overview**
**Description:**
提供NativeWindow功能,主要用来和egl对接 提供NativeWindow功能,主要用来和egl对接
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Since:** @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
8
**Version:** **自从:**
1.0
8
## **Summary** ## 汇总
### Files ### 文件
| File&nbsp;Name | Description | | 文件名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [external_window.h](external__window_8h.md) | 定义获取和使用NativeWindow的相关函数 | | [external_window.h](external__window_8h.md) | 定义获取和使用NativeWindow的相关函数 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_NativeWindow_CreateNativeWindowFromSurface&nbsp;(void&nbsp;\*pSurface) | struct&nbsp;NativeWindow&nbsp;\*<br/>创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 | | [OH_NativeWindow_CreateNativeWindowFromSurface](#oh_nativewindow_createnativewindowfromsurface) (void \*pSurface) | 创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 |
| OH_NativeWindow_DestroyNativeWindow&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window) | void<br/>将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindow](#oh_nativewindow_destroynativewindow) (struct NativeWindow \*window) | 将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 |
| OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer&nbsp;(void&nbsp;\*pSurfaceBuffer) | struct&nbsp;NativeWindowBuffer&nbsp;\*<br/>创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 | | [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | 创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 |
| OH_NativeWindow_DestroyNativeWindowBuffer&nbsp;(struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | void<br/>将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindowBuffer](#oh_nativewindow_destroynativewindowbuffer) (struct NativeWindowBuffer \*buffer) | 将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 |
| OH_NativeWindow_NativeWindowRequestBuffer&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*\*buffer,&nbsp;int&nbsp;\*fenceFd) | int32_t<br/>通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 | | [OH_NativeWindow_NativeWindowRequestBuffer](#oh_nativewindow_nativewindowrequestbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*\*buffer, int \*fenceFd) | 通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 |
| OH_NativeWindow_NativeWindowFlushBuffer&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*buffer,&nbsp;int&nbsp;fenceFd,&nbsp;Region&nbsp;region) | int32_t<br/>通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 | | [OH_NativeWindow_NativeWindowFlushBuffer](#oh_nativewindow_nativewindowflushbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*buffer, int fenceFd, Region region) | 通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 |
| OH_NativeWindow_NativeWindowCancelBuffer&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | int32_t<br/>通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 | | [OH_NativeWindow_NativeWindowCancelBuffer](#oh_nativewindow_nativewindowcancelbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*buffer) | 通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 |
| OH_NativeWindow_NativeWindowHandleOpt&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;int&nbsp;code,...) | int32_t<br/>设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 | | [OH_NativeWindow_NativeWindowHandleOpt](#oh_nativewindow_nativewindowhandleopt) (struct NativeWindow \*window, int code,...) | 设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 |
| OH_NativeWindow_GetBufferHandleFromNative&nbsp;(struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | BufferHandle&nbsp;\*<br/>通过NativeWindowBuffer获取该buffer的BufferHandle指针 | | [OH_NativeWindow_GetBufferHandleFromNative](#oh_nativewindow_getbufferhandlefromnative) (struct NativeWindowBuffer \*buffer) | 通过NativeWindowBuffer获取该buffer的BufferHandle指针 |
| OH_NativeWindow_NativeObjectReference&nbsp;(void&nbsp;\*obj) | int32_t<br/>增加一个NativeObject的引用计数 | | [OH_NativeWindow_NativeObjectReference](#oh_nativewindow_nativeobjectreference) (void \*obj) | 增加一个NativeObject的引用计数 |
| OH_NativeWindow_NativeObjectUnreference&nbsp;(void&nbsp;\*obj) | int32_t<br/>减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 | | [OH_NativeWindow_NativeObjectUnreference](#oh_nativewindow_nativeobjectunreference) (void \*obj) | 减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 |
| OH_NativeWindow_GetNativeObjectMagic&nbsp;(void&nbsp;\*obj) | int32_t<br/>获取NativeObject的MagicId | | [OH_NativeWindow_GetNativeObjectMagic](#oh_nativewindow_getnativeobjectmagic) (void \*obj) | 获取NativeObject的MagicId |
## **Details** ## 详细描述
## **Function** ## 函数说明
### OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer() ### OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer()
...@@ -59,22 +54,26 @@ ...@@ -59,22 +54,26 @@
struct NativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer (void * pSurfaceBuffer) struct NativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer (void * pSurfaceBuffer)
``` ```
**Description:** **描述:**
创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| pSurfaceBuffer | 参数是一个指向生产者buffer的指针,类型为sptr&lt;OHOS::SurfaceBuffer&gt; | | pSurfaceBuffer | 参数是一个指向生产者buffer的指针,类型为sptr&lt;OHOS::SurfaceBuffer&gt; |
**Returns:** **返回:**
返回一个指针,指向NativeWindowBuffer的结构体实例 返回一个指针,指向NativeWindowBuffer的结构体实例
**自从:**
8
### OH_NativeWindow_CreateNativeWindowFromSurface() ### OH_NativeWindow_CreateNativeWindowFromSurface()
...@@ -83,22 +82,26 @@ struct NativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBu ...@@ -83,22 +82,26 @@ struct NativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBu
struct NativeWindow* OH_NativeWindow_CreateNativeWindowFromSurface (void * pSurface) struct NativeWindow* OH_NativeWindow_CreateNativeWindowFromSurface (void * pSurface)
``` ```
**Description:** **描述:**
创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| pSurface | 参数是一个指向生产者ProduceSurface的指针,类型为sptr&lt;OHOS::Surface&gt; | | pSurface | 参数是一个指向生产者ProduceSurface的指针,类型为sptr&lt;OHOS::Surface&gt; |
**Returns:** **返回:**
返回一个指针,指向NativeWindow的结构体实例 返回一个指针,指向NativeWindow的结构体实例
**自从:**
8
### OH_NativeWindow_DestroyNativeWindow() ### OH_NativeWindow_DestroyNativeWindow()
...@@ -107,18 +110,22 @@ struct NativeWindow* OH_NativeWindow_CreateNativeWindowFromSurface (void * pSurf ...@@ -107,18 +110,22 @@ struct NativeWindow* OH_NativeWindow_CreateNativeWindowFromSurface (void * pSurf
void OH_NativeWindow_DestroyNativeWindow (struct NativeWindow * window) void OH_NativeWindow_DestroyNativeWindow (struct NativeWindow * window)
``` ```
**Description:** **描述:**
将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| window | 参数是一个NativeWindow的结构体实例的指针 | | window | 参数是一个NativeWindow的结构体实例的指针 |
**自从:**
8
### OH_NativeWindow_DestroyNativeWindowBuffer() ### OH_NativeWindow_DestroyNativeWindowBuffer()
...@@ -127,18 +134,22 @@ void OH_NativeWindow_DestroyNativeWindow (struct NativeWindow * window) ...@@ -127,18 +134,22 @@ void OH_NativeWindow_DestroyNativeWindow (struct NativeWindow * window)
void OH_NativeWindow_DestroyNativeWindowBuffer (struct NativeWindowBuffer * buffer) void OH_NativeWindow_DestroyNativeWindowBuffer (struct NativeWindowBuffer * buffer)
``` ```
**Description:** **描述:**
将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 | | buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 |
**自从:**
8
### OH_NativeWindow_GetBufferHandleFromNative() ### OH_NativeWindow_GetBufferHandleFromNative()
...@@ -147,22 +158,26 @@ void OH_NativeWindow_DestroyNativeWindowBuffer (struct NativeWindowBuffer * buff ...@@ -147,22 +158,26 @@ void OH_NativeWindow_DestroyNativeWindowBuffer (struct NativeWindowBuffer * buff
BufferHandle* OH_NativeWindow_GetBufferHandleFromNative (struct NativeWindowBuffer * buffer) BufferHandle* OH_NativeWindow_GetBufferHandleFromNative (struct NativeWindowBuffer * buffer)
``` ```
**Description:** **描述:**
通过NativeWindowBuffer获取该buffer的BufferHandle指针 通过NativeWindowBuffer获取该buffer的BufferHandle指针
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 | | buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 |
**Returns:** **返回:**
BufferHandle 返回一个指针,指向BufferHandle的结构体实例 BufferHandle 返回一个指针,指向BufferHandle的结构体实例
**自从:**
8
### OH_NativeWindow_GetNativeObjectMagic() ### OH_NativeWindow_GetNativeObjectMagic()
...@@ -171,22 +186,26 @@ BufferHandle 返回一个指针,指向BufferHandle的结构体实例 ...@@ -171,22 +186,26 @@ BufferHandle 返回一个指针,指向BufferHandle的结构体实例
int32_t OH_NativeWindow_GetNativeObjectMagic (void * obj) int32_t OH_NativeWindow_GetNativeObjectMagic (void * obj)
``` ```
**Description:** **描述:**
获取NativeObject的MagicId 获取NativeObject的MagicId
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| obj | 参数是一个NativeWindow&nbsp;or&nbsp;NativeWindowBuffer的结构体实例的指针 | | obj | 参数是一个NativeWindow or NativeWindowBuffer的结构体实例的指针 |
**Returns:** **返回:**
MagicId 返回值为魔鬼数字,每个NativeObject唯一 MagicId 返回值为魔鬼数字,每个NativeObject唯一
**自从:**
8
### OH_NativeWindow_NativeObjectReference() ### OH_NativeWindow_NativeObjectReference()
...@@ -195,22 +214,26 @@ MagicId 返回值为魔鬼数字,每个NativeObject唯一 ...@@ -195,22 +214,26 @@ MagicId 返回值为魔鬼数字,每个NativeObject唯一
int32_t OH_NativeWindow_NativeObjectReference (void * obj) int32_t OH_NativeWindow_NativeObjectReference (void * obj)
``` ```
**Description:** **描述:**
增加一个NativeObject的引用计数 增加一个NativeObject的引用计数
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| obj | 参数是一个NativeWindow&nbsp;or&nbsp;NativeWindowBuffer的结构体实例的指针 | | obj | 参数是一个NativeWindow or NativeWindowBuffer的结构体实例的指针 |
**Returns:** **返回:**
GSError 返回值为错误码 GSError 返回值为错误码
**自从:**
8
### OH_NativeWindow_NativeObjectUnreference() ### OH_NativeWindow_NativeObjectUnreference()
...@@ -219,22 +242,26 @@ GSError 返回值为错误码 ...@@ -219,22 +242,26 @@ GSError 返回值为错误码
int32_t OH_NativeWindow_NativeObjectUnreference (void * obj) int32_t OH_NativeWindow_NativeObjectUnreference (void * obj)
``` ```
**Description:** **描述:**
减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| obj | 参数是一个NativeWindow&nbsp;or&nbsp;NativeWindowBuffer的结构体实例的指针 | | obj | 参数是一个NativeWindow or NativeWindowBuffer的结构体实例的指针 |
**Returns:** **返回:**
GSError GSError
**自从:**
8
### OH_NativeWindow_NativeWindowCancelBuffer() ### OH_NativeWindow_NativeWindowCancelBuffer()
...@@ -243,23 +270,27 @@ GSError ...@@ -243,23 +270,27 @@ GSError
int32_t OH_NativeWindow_NativeWindowCancelBuffer (struct NativeWindow * window, struct NativeWindowBuffer * buffer ) int32_t OH_NativeWindow_NativeWindowCancelBuffer (struct NativeWindow * window, struct NativeWindowBuffer * buffer )
``` ```
**Description:** **描述:**
通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| window | 参数是一个NativeWindow的结构体实例的指针 | | window | 参数是一个NativeWindow的结构体实例的指针 |
| buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 | | buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 |
**Returns:** **返回:**
GSError 返回值为错误码 GSError 返回值为错误码
**自从:**
8
### OH_NativeWindow_NativeWindowFlushBuffer() ### OH_NativeWindow_NativeWindowFlushBuffer()
...@@ -268,25 +299,29 @@ GSError 返回值为错误码 ...@@ -268,25 +299,29 @@ GSError 返回值为错误码
int32_t OH_NativeWindow_NativeWindowFlushBuffer (struct NativeWindow * window, struct NativeWindowBuffer * buffer, int fenceFd, Region region ) int32_t OH_NativeWindow_NativeWindowFlushBuffer (struct NativeWindow * window, struct NativeWindowBuffer * buffer, int fenceFd, Region region )
``` ```
**Description:** **描述:**
通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| window | 参数是一个NativeWindow的结构体实例的指针 | | window | 参数是一个NativeWindow的结构体实例的指针 |
| buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 | | buffer | 参数是一个NativeWindowBuffer的结构体实例的指针 |
| fenceFd | 参数是一个文件描述符句柄,用以同步时序 | | fenceFd | 参数是一个文件描述符句柄,用以同步时序 |
| region | 参数表示一块脏区域,该区域有内容更新 | | region | 参数表示一块脏区域,该区域有内容更新 |
**Returns:** **返回:**
GSError 返回值为错误码 GSError 返回值为错误码
**自从:**
8
### OH_NativeWindow_NativeWindowHandleOpt() ### OH_NativeWindow_NativeWindowHandleOpt()
...@@ -295,23 +330,27 @@ GSError 返回值为错误码 ...@@ -295,23 +330,27 @@ GSError 返回值为错误码
int32_t OH_NativeWindow_NativeWindowHandleOpt (struct NativeWindow * window, int code, ... ) int32_t OH_NativeWindow_NativeWindowHandleOpt (struct NativeWindow * window, int code, ... )
``` ```
**Description:** **描述:**
设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| window | 参数是一个NativeWindow的结构体实例的指针 | | window | 参数是一个NativeWindow的结构体实例的指针 |
| code | 操作码 | | code | 操作码 |
**Returns:** **返回:**
GSError 返回值为错误码 GSError 返回值为错误码
**自从:**
8
### OH_NativeWindow_NativeWindowRequestBuffer() ### OH_NativeWindow_NativeWindowRequestBuffer()
...@@ -320,20 +359,24 @@ GSError 返回值为错误码 ...@@ -320,20 +359,24 @@ GSError 返回值为错误码
int32_t OH_NativeWindow_NativeWindowRequestBuffer (struct NativeWindow * window, struct NativeWindowBuffer ** buffer, int * fenceFd ) int32_t OH_NativeWindow_NativeWindowRequestBuffer (struct NativeWindow * window, struct NativeWindowBuffer ** buffer, int * fenceFd )
``` ```
**Description:** **描述:**
通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| window | 参数是一个NativeWindow的结构体实例的指针 | | window | 参数是一个NativeWindow的结构体实例的指针 |
| buffer | 参数是一个NativeWindowBuffer的结构体实例的二级指针 | | buffer | 参数是一个NativeWindowBuffer的结构体实例的二级指针 |
| fenceFd | 参数是一个文件描述符句柄 | | fenceFd | 参数是一个文件描述符句柄 |
**Returns:** **返回:**
GSError 返回值为错误码 GSError 返回值为错误码
**自从:**
8
# OH_Drawing_BitmapFormat # OH_Drawing_BitmapFormat
## **Overview** ## 概述
**Related Modules:**
[Drawing](_drawing.md)
**Description:**
结构体用于描述位图像素的格式,包括颜色类型和透明度类型 结构体用于描述位图像素的格式,包括颜色类型和透明度类型
**Since:** **自从:**
8 8
**Version:** **相关模块:**
1.0 [Drawing](_drawing.md)
## **Summary** ## 汇总
### Public Attributes ### 成员变量
| Public&nbsp;Attribute&nbsp;Name | Description | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| colorFormat | | | [colorFormat](#colorformat) | 描述位图像素的透明度分量 |
| alphaFormat | | | [alphaFormat](#alphaformat) | 描述位图像素的存储格式 |
## **Details**
## **Member Data** ## 结构体成员变量说明
### alphaFormat ### alphaFormat
...@@ -44,7 +35,7 @@ ...@@ -44,7 +35,7 @@
OH_Drawing_AlphaFormat OH_Drawing_BitmapFormat::alphaFormat OH_Drawing_AlphaFormat OH_Drawing_BitmapFormat::alphaFormat
``` ```
**Description:** **描述:**
描述位图像素的透明度分量 描述位图像素的透明度分量
...@@ -56,6 +47,6 @@ OH_Drawing_AlphaFormat OH_Drawing_BitmapFormat::alphaFormat ...@@ -56,6 +47,6 @@ OH_Drawing_AlphaFormat OH_Drawing_BitmapFormat::alphaFormat
OH_Drawing_ColorFormat OH_Drawing_BitmapFormat::colorFormat OH_Drawing_ColorFormat OH_Drawing_BitmapFormat::colorFormat
``` ```
**Description:** **描述:**
描述位图像素的存储格式 描述位图像素的存储格式
# OH_NativeBuffer
提供NativeBuffer功能
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**自从:**
9
## 汇总
### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [native_buffer.h](native__buffer_8h.md) | 定义获取和使用NativeBuffer的相关函数 |
### 结构体
| 结构体名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Alloc](#oh_nativebuffer_alloc) (const [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例 |
| [OH_NativeBuffer_Reference](#oh_nativebuffer_reference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数加1 |
| [OH_NativeBuffer_Unreference](#oh_nativebuffer_unreference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉 |
| [OH_NativeBuffer_GetConfig](#oh_nativebuffer_getconfig) (OH_NativeBuffer \*buffer, [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 用于获取OH_NativeBuffer的属性 |
| [OH_NativeBuffer_Map](#oh_nativebuffer_map) (OH_NativeBuffer \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间 |
| [OH_NativeBuffer_Unmap](#oh_nativebuffer_unmap) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除 |
| [OH_NativeBuffer_GetSeqNum](#oh_nativebuffer_getseqnum) (OH_NativeBuffer \*buffer) | 获取OH_NativeBuffer的序列号 |
## 详细描述
## 函数说明
### OH_NativeBuffer_Alloc()
```
OH_NativeBuffer* OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config * config)
```
**描述:**
通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| config | 参数是一个指向OH_NativeBuffer属性的指针,类型为OH_NativeBuffer_Config |
**返回:**
创建成功则返回一个指向OH_NativeBuffer结构体实例的指针,否则返回NULL
**自从:**
9
### OH_NativeBuffer_GetConfig()
```
void OH_NativeBuffer_GetConfig (OH_NativeBuffer * buffer, OH_NativeBuffer_Config * config )
```
**描述:**
用于获取OH_NativeBuffer的属性
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
| config | 参数是一个指向OH_NativeBuffer_Config的指针,用于接收OH_NativeBuffer的属性 |
**自从:**
9
### OH_NativeBuffer_GetSeqNum()
```
uint32_t OH_NativeBuffer_GetSeqNum (OH_NativeBuffer * buffer)
```
**描述:**
获取OH_NativeBuffer的序列号
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
**返回:**
返回对应OH_NativeBuffer的唯一序列号
**自从:**
9
### OH_NativeBuffer_Map()
```
int32_t OH_NativeBuffer_Map (OH_NativeBuffer * buffer, void ** virAddr )
```
**描述:**
将OH_NativeBuffer对应的ION内存映射到进程空间
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
| virAddr | 参数是一个二级指针,二级指针指向虚拟内存的地址 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**自从:**
9
### OH_NativeBuffer_Reference()
```
int32_t OH_NativeBuffer_Reference (OH_NativeBuffer * buffer)
```
**描述:**
将OH_NativeBuffer对象的引用计数加1
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**自从:**
9
### OH_NativeBuffer_Unmap()
```
int32_t OH_NativeBuffer_Unmap (OH_NativeBuffer * buffer)
```
**描述:**
将OH_NativeBuffer对应的ION内存从进程空间移除
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**自从:**
9
### OH_NativeBuffer_Unreference()
```
int32_t OH_NativeBuffer_Unreference (OH_NativeBuffer * buffer)
```
**描述:**
将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数:**
| Name | 描述 |
| -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**自从:**
9
# OH_NativeBuffer_Config
## 概述
OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。
**自从:**
9
**相关模块:**
[OH_NativeBuffer](_o_h___native_buffer.md)
## 汇总
### 成员变量
| 成员变量名称 | 描述 |
| -------- | -------- |
| width | 宽度(像素) |
| height | 高度(像素) |
| format | 像素格式 |
| usage | buffer的用途说明 |
# OH_NativeImage
提供NativeImage功能。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**自从:**
9
## 汇总
### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [native_image.h](native__image_8h.md) | 定义获取和使用NativeImage的相关函数。 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeImage_Create]( #oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联。 |
| [OH_NativeImage_AcquireNativeWindow]( #oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放。 |
| [OH_NativeImage_AttachContext]( #oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OPENGL ES上下文, 且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新。 |
| [OH_NativeImage_DetachContext]( #oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OPENGL ES上下文分离。 |
| [OH_NativeImage_UpdateSurfaceImage]( #oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理。 |
| [OH_NativeImage_GetTimestamp]( #oh_nativeimage_gettimestamp) (OH_NativeImage \*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳。 |
| [OH_NativeImage_GetTransformMatrix]( #oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵。 |
| [OH_NativeImage_Destroy]( #oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空。 |
## 详细描述
## 函数说明
### OH_NativeImage_AcquireNativeWindow()
```
OHNativeWindow* OH_NativeImage_AcquireNativeWindow (OH_NativeImage * image)
```
**描述:**
获取与OH_NativeImage相关联的OHNativeWindow指针。该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向&lt;b&gt;OH_NativeImage&lt;/b&gt;实例的指针。 |
**返回:**
成功则返回一个指向OHNativeWindow实例的指针,否则返回**NULL**
**自从:**
9
### OH_NativeImage_AttachContext()
```
int32_t OH_NativeImage_AttachContext (OH_NativeImage * image, uint32_t textureId )
```
**描述:**
将OH_NativeImage实例附加到当前OPENGL ES上下文,且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES,并通过OH_NativeImage进行更新。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
| textureId | OH_NativeImage要附加到的OPENGL ES纹理的id。 |
**返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**自从:**
9
### OH_NativeImage_Create()
```
OH_NativeImage* OH_NativeImage_Create (uint32_t textureId, uint32_t textureTarget )
```
**描述:**
创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| textureId | OPENGL ES的纹理ID,OH_NativeImage实例会与之相关联。 |
| textureTarget | OPENGL ES的纹理目标。 |
**返回:**
返回一个指向**OH_NativeImage**实例的指针,否则返回**NULL**
**自从:**
9
### OH_NativeImage_Destroy()
```
void OH_NativeImage_Destroy (OH_NativeImage ** image)
```
**描述:**
销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空.
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
### OH_NativeImage_DetachContext()
```
int32_t OH_NativeImage_DetachContext (OH_NativeImage * image)
```
**描述:**
将OH_NativeImage实例从当前OPENGL ES上下文分离。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
**返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**自从:**
9
### OH_NativeImage_GetTimestamp()
```
int64_t OH_NativeImage_GetTimestamp (OH_NativeImage * image)
```
**描述:**
获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
**返回:**
返回纹理图像的相关时间戳。
**自从:**
9
### OH_NativeImage_GetTransformMatrix()
```
int32_t OH_NativeImage_GetTransformMatrix (OH_NativeImage * image, float matrix[16] )
```
**描述:**
获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
| matrix | 用来存储要获取的4\*4的变化矩阵。 |
**返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**自从:**
9
### OH_NativeImage_UpdateSurfaceImage()
```
int32_t OH_NativeImage_UpdateSurfaceImage (OH_NativeImage * image)
```
**描述:**
通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数:**
| Name | 描述 |
| -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 |
**返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**自从:**
9
# Native XComponent # Native XComponent
## **Overview** 描述ArkUI XComponent持有的surface和触摸事件,该事件可用于EGL/OpenGLES和媒体数据输入,并显示在ArkUI XComponent上。
**Description:**
Describes the surface and touch event held by the ArkUI XComponent, which can be used for the EGL/OpenGLES and media data input and displayed on the ArkUI XComponent. **自从:**
**Since:**
8 8
**Version:**
1.0 ## 汇总
## **Summary** ### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) | 声明用于访问Native XComponent的API。 |
### Files ### 结构体
| File&nbsp;Name | Description | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) | Declares&nbsp;APIs&nbsp;for&nbsp;accessing&nbsp;a&nbsp;Native&nbsp;XComponent. | | [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | 触摸事件中触摸点的信息。 |
| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | 触摸事件。 |
| [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) | 鼠标事件。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | 注册surface生命周期和触摸事件回调。 |
| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) | 注册鼠标事件的回调。 |
### Classes ### 类型定义
| Classe&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | | | [OH_NativeXComponent](#oh_nativexcomponent) | 提供封装的OH_NativeXComponent实例。 |
| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | | | [OH_NativeXComponent_Callback](#oh_nativexcomponent_callback) | 注册surface生命周期和触摸事件回调。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers&nbsp;the&nbsp;surface&nbsp;lifecycle&nbsp;and&nbsp;touch&nbsp;event&nbsp;callbacks. | | [OH_NativeXComponent_MouseEvent_Callback](#oh_nativexcomponent_mouseevent_callback) | 注册鼠标事件的回调。 |
### Macros ### 枚举
| Macro&nbsp;Name&nbsp;and&nbsp;Value | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| **OH_NATIVE_XCOMPONENT_OBJ**&nbsp;&nbsp;&nbsp;("__NATIVE_XCOMPONENT_OBJ__") | | | {OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, <br>OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, <br/>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, <br/>OHOS_IMAGE_RESULT_SUCCESS = 0, <br/>OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | [枚举](#anonymous-enum)API访问状态。 |
| [OH_NativeXComponent_TouchEventType](#oh_nativexcomponent_toucheventtype) { <br/>OH_NATIVEXCOMPONENT_DOWN = 0, <br/>OH_NATIVEXCOMPONENT_UP, <br/>OH_NATIVEXCOMPONENT_MOVE, <br/>OH_NATIVEXCOMPONENT_CANCEL,<br/>OH_NATIVEXCOMPONENT_UNKNOWN } | 触摸事件类型。 |
| [OH_NativeXComponent_MouseEventAction](#oh_nativexcomponent_mouseeventaction) { <br/>OH_NATIVEXCOMPONENT_MOUSE_NONE = 0, <br/>OH_NATIVEXCOMPONENT_MOUSE_PRESS, <br/>OH_NATIVEXCOMPONENT_MOUSE_RELEASE, <br/>OH_NATIVEXCOMPONENT_MOUSE_MOVE } | 鼠标事件动作。 |
| [OH_NativeXComponent_MouseEventButton](#oh_nativexcomponent_mouseeventbutton) { <br/>OH_NATIVEXCOMPONENT_NONE_BUTTON = 0, <br/>OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01, <br/>OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02, <br/>OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04, <br/>OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08, <br/>OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10 } | 鼠标事件按键。 |
### Typedefs ### 函数
| Typedef&nbsp;Name | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_NativeXComponent | typedef&nbsp;struct&nbsp;OH_NativeXComponent<br/>Provides&nbsp;an&nbsp;encapsulated&nbsp;**OH_NativeXComponent**&nbsp;instance. | | [OH_NativeXComponent_GetXComponentId](#oh_nativexcomponent_getxcomponentid) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, char \*id, uint64_t \*size) | 获取ArkUI XComponent的id。 |
| OH_NativeXComponent_Callback | typedef&nbsp;struct&nbsp;OH_NativeXComponent_Callback<br/>Registers&nbsp;the&nbsp;surface&nbsp;lifecycle&nbsp;and&nbsp;touch&nbsp;event&nbsp;callbacks. | | [OH_NativeXComponent_GetXComponentSize](#oh_nativexcomponent_getxcomponentsize) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, uint64_t \*width, uint64_t \*height) | 获取ArkUI XComponent持有的surface的大小。 |
| [OH_NativeXComponent_GetXComponentOffset](#oh_nativexcomponent_getxcomponentoffset) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, double \*x, double \*y) | 获取ArkUI XComponent组件相对屏幕左上顶点的偏移量。 |
| [OH_NativeXComponent_GetTouchEvent](#oh_nativexcomponent_gettouchevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) \*touchEvent) | 获取ArkUI XComponent调度的触摸事件。 |
| [OH_NativeXComponent_GetMouseEvent](#oh_nativexcomponent_getmouseevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) \*mouseEvent) | 获取ArkUI XComponent调度的鼠标事件 |
| [OH_NativeXComponent_RegisterCallback](#oh_nativexcomponent_registercallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) \*callback) | 为此OH_NativeXComponent实例注册回调。 |
| [OH_NativeXComponent_RegisterMouseEventCallback](#oh_nativexcomponent_registermouseeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) \*callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 |
### Enumerations ### 变量
| Enumeration&nbsp;Name | Description | | 变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| {&nbsp;OH_NATIVEXCOMPONENT_RESULT_SUCCESS&nbsp;=&nbsp;0,&nbsp;OH_NATIVEXCOMPONENT_RESULT_FAILED&nbsp;=&nbsp;-1,&nbsp;OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER&nbsp;=&nbsp;-2&nbsp;} | Enumerates&nbsp;the&nbsp;API&nbsp;access&nbsp;states. | | [OH_XCOMPONENT_ID_LEN_MAX](#oh_xcomponent_id_len_max) = 128 | ArkUI XComponent的id最大长度。 |
| OH_NativeXComponent_TouchEventType&nbsp;{&nbsp;&nbsp;&nbsp;OH_NATIVEXCOMPONENT_DOWN&nbsp;=&nbsp;0,&nbsp;OH_NATIVEXCOMPONENT_UP,&nbsp;OH_NATIVEXCOMPONENT_MOVE,&nbsp;OH_NATIVEXCOMPONENT_CANCEL,&nbsp;&nbsp;&nbsp;OH_NATIVEXCOMPONENT_UNKNOWN&nbsp;} | | | [OH_MAX_TOUCH_POINTS_NUMBER](#oh_max_touch_points_number) = 10 | 触摸事件中的可识别的触摸点个数最大值。 |
| [OH_NativeXComponent_TouchPoint::id](#id-12) = 0 | 手指的唯一标识符。 |
| [OH_NativeXComponent_TouchPoint::screenX](#screenx-13) = 0.0 | 触摸点相对于屏幕左边缘的x坐标。 |
| [OH_NativeXComponent_TouchPoint::screenY](#screeny-13) = 0.0 | 触摸点相对于屏幕上边缘的y坐标。 |
| [OH_NativeXComponent_TouchPoint::x](#x-13) = 0.0 | 触摸点相对于XComponent组件左边缘的x坐标。 |
| [OH_NativeXComponent_TouchPoint::y](#y-13) = 0.0 | 触摸点相对于XComponent组件上边缘的y坐标。 |
| [OH_NativeXComponent_TouchPoint::type](#type-12) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | 触摸事件的触摸类型。 |
| [OH_NativeXComponent_TouchPoint::size](#size-12) = 0.0 | 指垫和屏幕之间的接触面积。 |
| [OH_NativeXComponent_TouchPoint::force](#force-12) = 0.0 | 当前触摸事件的压力。 |
| [OH_NativeXComponent_TouchPoint::timeStamp](#timestamp-12) = 0 | 当前触摸事件的时间戳。 |
| [OH_NativeXComponent_TouchPoint::isPressed](#ispressed) = false | 当前点是否被按下。 |
| [OH_NativeXComponent_TouchEvent::id](#id-22) = 0 | 手指的唯一标识符。 |
| [OH_NativeXComponent_TouchEvent::screenX](#screenx-23) = 0.0 | 触摸点相对于屏幕左边缘的x坐标。 |
| [OH_NativeXComponent_TouchEvent::screenY](#screeny-23) = 0.0 | 触摸点相对于屏幕上边缘的y坐标。 |
| [OH_NativeXComponent_TouchEvent::x](#x-23) = 0.0 | 触摸点相对于XComponent组件左边缘的x坐标。 |
| [OH_NativeXComponent_TouchEvent::y](#y-23) = 0.0 | 触摸点相对于XComponent组件上边缘的y坐标。 |
| [OH_NativeXComponent_TouchEvent::type](#type-22) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | 触摸事件的触摸类型。 |
| [OH_NativeXComponent_TouchEvent::size](#size-22) = 0.0 | 指垫和屏幕之间的接触面积。 |
| [OH_NativeXComponent_TouchEvent::force](#force-22) = 0.0 | 当前触摸事件的压力。 |
| [OH_NativeXComponent_TouchEvent::deviceId](#deviceid) = 0 | 产生当前触摸事件的设备的ID。 |
| [OH_NativeXComponent_TouchEvent::timeStamp](#timestamp-22) = 0 | 当前触摸事件的时间戳。 |
| [OH_NativeXComponent_TouchEvent::touchPoints](#touchpoints) [OH_MAX_TOUCH_POINTS_NUMBER] | 当前触摸点的数组。 |
| [OH_NativeXComponent_TouchEvent::numPoints](#numpoints) = 0 | 当前接触点的数量。 |
| [OH_NativeXComponent_MouseEvent::x](#x-33) | 点击触点相对于当前组件左上角的x轴坐标。 |
| [OH_NativeXComponent_MouseEvent::y](#y-33) | 点击触点相对于当前组件左上角的y轴坐标。 |
| [OH_NativeXComponent_MouseEvent::screenX](#screenx-33) | 点击触点相对于屏幕左上角的x轴坐标。 |
| [OH_NativeXComponent_MouseEvent::screenY](#screeny-33) | 点击触点相对于屏幕左上角的y轴坐标。 |
| [OH_NativeXComponent_MouseEvent::timestamp](#timestamp) | 当前鼠标事件的时间戳。 |
| [OH_NativeXComponent_MouseEvent::action](#action) | 当前鼠标事件动作。 |
| [OH_NativeXComponent_MouseEvent::button](#button) | 鼠标事件按键。 |
| [OH_NativeXComponent_Callback::OnSurfaceCreated](#onsurfacecreated) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window) | 创建surface时调用。 |
| [OH_NativeXComponent_Callback::OnSurfaceChanged](#onsurfacechanged) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window) | 当surface改变时调用。 |
| [OH_NativeXComponent_Callback::OnSurfaceDestroyed](#onsurfacedestroyed) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window) | 当surface被破坏时调用。 |
| [OH_NativeXComponent_Callback::DispatchTouchEvent](#dispatchtouchevent) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window) | 当触摸事件被触发时调用。 |
| [OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent](#dispatchmouseevent) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window) | 当鼠标事件被触发时调用。 |
| [OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent](#dispatchhoverevent) )([OH_NativeXComponent](#oh_nativexcomponent) \*component, bool isHover) | 当悬停事件被触发时调用。 |
## 详细描述
## 类型定义说明
### Functions ### OH_NativeXComponent
| Function | Description |
| -------- | -------- |
| OH_NativeXComponent_GetXComponentId&nbsp;(OH_NativeXComponent&nbsp;\*component,&nbsp;char&nbsp;\*id,&nbsp;uint64_t&nbsp;\*size) | int32_t<br/>Obtains&nbsp;the&nbsp;ID&nbsp;of&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| OH_NativeXComponent_GetXComponentSize&nbsp;(OH_NativeXComponent&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;uint64_t&nbsp;\*width,&nbsp;uint64_t&nbsp;\*height) | int32_t<br/>Obtains&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;surface&nbsp;held&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| OH_NativeXComponent_GetXComponentOffset&nbsp;(OH_NativeXComponent&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;double&nbsp;\*x,&nbsp;double&nbsp;\*y) | int32_t<br/>Obtains&nbsp;the&nbsp;offset&nbsp;of&nbsp;the&nbsp;surface&nbsp;held&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| OH_NativeXComponent_GetTouchEvent&nbsp;(OH_NativeXComponent&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;OH_NativeXComponent_TouchEvent&nbsp;\*touchEvent) | int32_t<br/>Obtains&nbsp;the&nbsp;touch&nbsp;event&nbsp;dispatched&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| OH_NativeXComponent_RegisterCallback&nbsp;(OH_NativeXComponent&nbsp;\*component,&nbsp;OH_NativeXComponent_Callback&nbsp;\*callback) | int32_t<br/>Registers&nbsp;a&nbsp;callback&nbsp;for&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. |
```
typedef struct OH_NativeXComponent OH_NativeXComponent
```
## **Details** **描述:**
提供封装的OH_NativeXComponent实例。
## **Typedef** **自从:**
8
### OH_NativeXComponent
### OH_NativeXComponent_Callback
``` ```
typedef struct OH_NativeXComponent OH_NativeXComponent typedef struct OH_NativeXComponent_Callback OH_NativeXComponent_Callback
``` ```
**Description:** **描述:**
Provides an encapsulated **OH_NativeXComponent** instance. 注册surface生命周期和触摸事件回调。
**自从:**
### OH_NativeXComponent_Callback 8
### OH_NativeXComponent_MouseEvent_Callback
``` ```
typedef struct OH_NativeXComponent_Callback OH_NativeXComponent_Callback typedef struct OH_NativeXComponent_MouseEvent_Callback OH_NativeXComponent_MouseEvent_Callback
``` ```
**Description:** **描述:**
注册鼠标事件的回调。
Registers the surface lifecycle and touch event callbacks. **自从:**
9
## **Enumeration Type**
## 枚举类型说明
### anonymous enum ### anonymous enum
...@@ -109,15 +170,69 @@ Registers the surface lifecycle and touch event callbacks. ...@@ -109,15 +170,69 @@ Registers the surface lifecycle and touch event callbacks.
anonymous enum anonymous enum
``` ```
**Description:** **描述:**
枚举API访问状态。
| 枚举值 | 描述 |
| -------- | -------- |
| OH_NATIVEXCOMPONENT_RESULT_SUCCESS | 成功结果。 |
| OH_NATIVEXCOMPONENT_RESULT_FAILED | 失败结果。 |
| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | 无效参数。 |
| OHOS_IMAGE_RESULT_SUCCESS | 成功的结果 |
| OHOS_IMAGE_RESULT_BAD_PARAMETER | 无效值 |
**自从:**
8
### OH_NativeXComponent_MouseEventAction
```
enum OH_NativeXComponent_MouseEventAction
```
**描述:**
鼠标事件动作.
| 枚举值 | 描述 |
| -------- | -------- |
| OH_NATIVEXCOMPONENT_MOUSE_NONE | 无效鼠标事件 。 |
| OH_NATIVEXCOMPONENT_MOUSE_PRESS | 鼠标按键按下时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_MOUSE_RELEASE | 鼠标按键松开时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_MOUSE_MOVE | 鼠标在屏幕上移动时触发鼠标事件。 |
**自从:**
9
### OH_NativeXComponent_MouseEventButton
```
enum OH_NativeXComponent_MouseEventButton
```
**描述:**
Enumerates the API access states. 鼠标事件按键。
| Enumerator | Description | | 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_NATIVEXCOMPONENT_RESULT_SUCCESS | Success&nbsp;result. | | OH_NATIVEXCOMPONENT_NONE_BUTTON | 鼠标无按键操作时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_RESULT_FAILED | Failed&nbsp;result. | | OH_NATIVEXCOMPONENT_LEFT_BUTTON | 按下鼠标左键时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | Invalid&nbsp;parameters. | | OH_NATIVEXCOMPONENT_RIGHT_BUTTON | 按下鼠标右键时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_MIDDLE_BUTTON | 按下鼠标中键时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_BACK_BUTTON | 按下鼠标左侧后退键时触发鼠标事件。 |
| OH_NATIVEXCOMPONENT_FORWARD_BUTTON | 按下鼠标左侧前进键时触发鼠标事件。 |
**自从:**
9
### OH_NativeXComponent_TouchEventType ### OH_NativeXComponent_TouchEventType
...@@ -127,16 +242,52 @@ Enumerates the API access states. ...@@ -127,16 +242,52 @@ Enumerates the API access states.
enum OH_NativeXComponent_TouchEventType enum OH_NativeXComponent_TouchEventType
``` ```
| Enumerator | Description | **描述:**
触摸事件类型。
| 枚举值 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_NATIVEXCOMPONENT_DOWN | Trigger&nbsp;a&nbsp;touch&nbsp;event&nbsp;when&nbsp;a&nbsp;finger&nbsp;is&nbsp;pressed. | | OH_NATIVEXCOMPONENT_DOWN | 手指按下时触发触摸事件。 |
| OH_NATIVEXCOMPONENT_UP | Trigger&nbsp;a&nbsp;touch&nbsp;event&nbsp;when&nbsp;a&nbsp;finger&nbsp;is&nbsp;lifted. | | OH_NATIVEXCOMPONENT_UP | 手指抬起时触发触摸事件。 |
| OH_NATIVEXCOMPONENT_MOVE | Trigger&nbsp;a&nbsp;touch&nbsp;event&nbsp;when&nbsp;a&nbsp;finger&nbsp;moves&nbsp;on&nbsp;the&nbsp;screen&nbsp;in&nbsp;pressed&nbsp;state. | | OH_NATIVEXCOMPONENT_MOVE | 手指按下状态下在屏幕上移动时触发触摸事件。 |
| OH_NATIVEXCOMPONENT_CANCEL | Trigger&nbsp;an&nbsp;event&nbsp;when&nbsp;a&nbsp;touch&nbsp;event&nbsp;is&nbsp;canceled. | | OH_NATIVEXCOMPONENT_CANCEL | 触摸事件取消时触发事件。 |
| OH_NATIVEXCOMPONENT_UNKNOWN | Invalid&nbsp;touch&nbsp;type. | | OH_NATIVEXCOMPONENT_UNKNOWN | 无效的触摸类型。 |
**自从:**
8
## **Function** ## 函数说明
### OH_NativeXComponent_GetMouseEvent()
```
int32_t OH_NativeXComponent_GetMouseEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_MouseEvent * mouseEvent )
```
**描述:**
获取ArkUI XComponent调度的鼠标事件
**参数:**
| Name | 描述 |
| -------- | -------- |
| component | 表示指向OH_NativeXComponent实例的指针。 |
| window | 表示NativeWindow句柄。 |
| mouseEvent | 指示指向当前鼠标事件的指针。 |
**返回:**
返回执行的状态代码。
**自从:**
9
### OH_NativeXComponent_GetTouchEvent() ### OH_NativeXComponent_GetTouchEvent()
...@@ -146,21 +297,25 @@ enum OH_NativeXComponent_TouchEventType ...@@ -146,21 +297,25 @@ enum OH_NativeXComponent_TouchEventType
int32_t OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_TouchEvent * touchEvent ) int32_t OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_TouchEvent * touchEvent )
``` ```
**Description:** **描述:**
Obtains the touch event dispatched by the ArkUI XComponent. 获取ArkUI XComponent调度的触摸事件。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| component | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. | | component | 表示指向OH_NativeXComponent实例的指针。 |
| window | Indicates&nbsp;the&nbsp;native&nbsp;window&nbsp;handler. | | window | 表示NativeWindow句柄。 |
| touchEvent | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;current&nbsp;touch&nbsp;event. | | touchEvent | 指示指向当前触摸事件的指针。 |
**返回:**
**Returns:** 返回执行的状态代码。
Returns the status code of the execution. **自从:**
8
### OH_NativeXComponent_GetXComponentId() ### OH_NativeXComponent_GetXComponentId()
...@@ -170,21 +325,25 @@ Returns the status code of the execution. ...@@ -170,21 +325,25 @@ Returns the status code of the execution.
int32_t OH_NativeXComponent_GetXComponentId (OH_NativeXComponent * component, char * id, uint64_t * size ) int32_t OH_NativeXComponent_GetXComponentId (OH_NativeXComponent * component, char * id, uint64_t * size )
``` ```
**Description:** **描述:**
Obtains the ID of the ArkUI XComponent. 获取ArkUI XComponent的id。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| component | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. | | component | 表示指向OH_NativeXComponent实例的指针。 |
| id | Indicates&nbsp;the&nbsp;char&nbsp;buffer&nbsp;to&nbsp;keep&nbsp;the&nbsp;ID&nbsp;of&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance.&nbsp;Note&nbsp;that&nbsp;a&nbsp;null-terminator&nbsp;will&nbsp;be&nbsp;appended&nbsp;to&nbsp;the&nbsp;char&nbsp;buffer,&nbsp;so&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;char&nbsp;buffer&nbsp;should&nbsp;be&nbsp;at&nbsp;least&nbsp;as&nbsp;large&nbsp;as&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;real&nbsp;id&nbsp;length&nbsp;plus&nbsp;1.&nbsp;It&nbsp;is&nbsp;recommended&nbsp;that&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;char&nbsp;buffer&nbsp;be&nbsp;[OH_XCOMPONENT_ID_LEN_MAX&nbsp;+&nbsp;1]. | | id | 指示用于保存此OH_NativeXComponent实例的ID的字符缓冲区。 请注意,空终止符将附加到字符缓冲区,因此字符缓冲区的大小应至少比真实id长度大一个单位。 建议字符缓冲区的大小为[OH_XCOMPONENT_ID_LEN_MAX + 1]。 |
| size | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;length&nbsp;of&nbsp;**id**,&nbsp;which&nbsp;you&nbsp;can&nbsp;set&nbsp;and&nbsp;receive. | | size | 指示指向id长度的指针。 |
**Returns:** **返回:**
Returns the status code of the execution. 返回执行的状态代码。
**自从:**
8
### OH_NativeXComponent_GetXComponentOffset() ### OH_NativeXComponent_GetXComponentOffset()
...@@ -194,22 +353,26 @@ Returns the status code of the execution. ...@@ -194,22 +353,26 @@ Returns the status code of the execution.
int32_t OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent * component, const void * window, double * x, double * y ) int32_t OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent * component, const void * window, double * x, double * y )
``` ```
**Description:** **描述:**
Obtains the offset of the surface held by the ArkUI XComponent. 获取ArkUI XComponent组件相对屏幕左上顶点的偏移量。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| component | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. | | component | 表示指向OH_NativeXComponent实例的指针。 |
| window | Indicates&nbsp;the&nbsp;native&nbsp;window&nbsp;handler. | | window | 表示NativeWindow句柄。 |
| x | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;x&nbsp;coordinate&nbsp;of&nbsp;the&nbsp;current&nbsp;surface. | | x | 指示指向当前surface的x坐标的指针。 |
| y | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;y&nbsp;coordinate&nbsp;of&nbsp;the&nbsp;current&nbsp;surface. | | y | 指示指向当前surface的y坐标的指针。 |
**返回:**
**Returns:** 返回执行的状态代码。
Returns the status code of the execution. **自从:**
8
### OH_NativeXComponent_GetXComponentSize() ### OH_NativeXComponent_GetXComponentSize()
...@@ -219,22 +382,26 @@ Returns the status code of the execution. ...@@ -219,22 +382,26 @@ Returns the status code of the execution.
int32_t OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent * component, const void * window, uint64_t * width, uint64_t * height ) int32_t OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent * component, const void * window, uint64_t * width, uint64_t * height )
``` ```
**Description:** **描述:**
Obtains the size of the surface held by the ArkUI XComponent. 获取ArkUI XComponent持有的surface的大小。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| component | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. | | component | 表示指向OH_NativeXComponent实例的指针。 |
| window | Indicates&nbsp;the&nbsp;native&nbsp;window&nbsp;handler. | | window | 表示NativeWindow句柄。 |
| width | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;current&nbsp;surface. | | width | 指示指向当前surface宽度的指针。 |
| height | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;height&nbsp;of&nbsp;the&nbsp;current&nbsp;surface. | | height | 指示指向当前surface高度的指针。 |
**返回:**
**Returns:** 返回执行的状态代码。
Returns the status code of the execution. **自从:**
8
### OH_NativeXComponent_RegisterCallback() ### OH_NativeXComponent_RegisterCallback()
...@@ -244,23 +411,118 @@ Returns the status code of the execution. ...@@ -244,23 +411,118 @@ Returns the status code of the execution.
int32_t OH_NativeXComponent_RegisterCallback (OH_NativeXComponent * component, OH_NativeXComponent_Callback * callback ) int32_t OH_NativeXComponent_RegisterCallback (OH_NativeXComponent * component, OH_NativeXComponent_Callback * callback )
``` ```
**Description:** **描述:**
Registers a callback for this **OH_NativeXComponent** instance. 为此OH_NativeXComponent实例注册回调。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| component | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. | | component | 表示指向OH_NativeXComponent实例的指针。 |
| callback | Indicates&nbsp;the&nbsp;pointer&nbsp;to&nbsp;a&nbsp;surface&nbsp;lifecycle&nbsp;and&nbsp;touch&nbsp;event&nbsp;callback. | | callback | 指示指向surface生命周期和触摸事件回调的指针。 |
**返回:**
返回执行的状态代码。
**自从:**
8
### OH_NativeXComponent_RegisterMouseEventCallback()
```
int32_t OH_NativeXComponent_RegisterMouseEventCallback (OH_NativeXComponent * component, OH_NativeXComponent_MouseEvent_Callback * callback )
```
**描述:**
为此OH_NativeXComponent实例注册鼠标事件回调。
**参数:**
| Name | 描述 |
| -------- | -------- |
| component | 表示指向OH_NativeXComponent实例的指针。 |
| callback | 指示指向鼠标事件回调的指针。 |
**返回:**
返回执行的状态代码。
**自从:**
9
## 变量说明
### OH_XCOMPONENT_ID_LEN_MAX
```
const uint32_t OH_XCOMPONENT_ID_LEN_MAX = 128
```
**描述:**
ArkUI XComponent的id最大长度。
**自从:**
8
### OH_MAX_TOUCH_POINTS_NUMBER
```
const uint32_t OH_MAX_TOUCH_POINTS_NUMBER = 10
```
**描述:**
**Returns:** 触摸事件中的可识别的触摸点个数最大值。
Returns the status code of the execution. **自从:**
8
## **Variable** ### action
```
OH_NativeXComponent_MouseEventAction OH_NativeXComponent_MouseEvent::action
```
**描述:**
当前鼠标事件动作。
**自从:**
8
### button
```
OH_NativeXComponent_MouseEventButton OH_NativeXComponent_MouseEvent::button
```
**描述:**
鼠标事件按键
**自从:**
8
### deviceId ### deviceId
...@@ -270,9 +532,45 @@ Returns the status code of the execution. ...@@ -270,9 +532,45 @@ Returns the status code of the execution.
int64_t OH_NativeXComponent_TouchEvent::deviceId = 0 int64_t OH_NativeXComponent_TouchEvent::deviceId = 0
``` ```
**Description:** **描述:**
产生当前触摸事件的设备的ID。
**自从:**
8
### DispatchHoverEvent
```
void(* OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent) (OH_NativeXComponent *component, bool isHover)
```
**描述:**
当悬停事件被触发时调用。
ID of the device where the current touch event is generated. **自从:**
8
### DispatchMouseEvent
```
void(* OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent) (OH_NativeXComponent *component, void *window)
```
**描述:**
当鼠标事件被触发时调用。
**自从:**
8
### DispatchTouchEvent ### DispatchTouchEvent
...@@ -282,9 +580,13 @@ ID of the device where the current touch event is generated. ...@@ -282,9 +580,13 @@ ID of the device where the current touch event is generated.
void(* OH_NativeXComponent_Callback::DispatchTouchEvent) (OH_NativeXComponent *component, void *window) void(* OH_NativeXComponent_Callback::DispatchTouchEvent) (OH_NativeXComponent *component, void *window)
``` ```
**Description:** **描述:**
Called when a touch event is triggered. 当触摸事件被触发时调用。
**自从:**
8
### force [1/2] ### force [1/2]
...@@ -294,9 +596,13 @@ Called when a touch event is triggered. ...@@ -294,9 +596,13 @@ Called when a touch event is triggered.
float OH_NativeXComponent_TouchPoint::force = 0.0 float OH_NativeXComponent_TouchPoint::force = 0.0
``` ```
**Description:** **描述:**
当前触摸事件的压力。
Pressure of the current touch event. **自从:**
8
### force [2/2] ### force [2/2]
...@@ -306,9 +612,13 @@ Pressure of the current touch event. ...@@ -306,9 +612,13 @@ Pressure of the current touch event.
float OH_NativeXComponent_TouchEvent::force = 0.0 float OH_NativeXComponent_TouchEvent::force = 0.0
``` ```
**Description:** **描述:**
Pressure of the current touch event. 当前触摸事件的压力。
**自从:**
8
### id [1/2] ### id [1/2]
...@@ -318,9 +628,13 @@ Pressure of the current touch event. ...@@ -318,9 +628,13 @@ Pressure of the current touch event.
int32_t OH_NativeXComponent_TouchPoint::id = 0 int32_t OH_NativeXComponent_TouchPoint::id = 0
``` ```
**Description:** **描述:**
手指的唯一标识符。
Unique identifier of a finger. **自从:**
8
### id [2/2] ### id [2/2]
...@@ -330,9 +644,13 @@ Unique identifier of a finger. ...@@ -330,9 +644,13 @@ Unique identifier of a finger.
int32_t OH_NativeXComponent_TouchEvent::id = 0 int32_t OH_NativeXComponent_TouchEvent::id = 0
``` ```
**Description:** **描述:**
手指的唯一标识符。
Unique identifier of a finger. **自从:**
8
### isPressed ### isPressed
...@@ -342,9 +660,13 @@ Unique identifier of a finger. ...@@ -342,9 +660,13 @@ Unique identifier of a finger.
bool OH_NativeXComponent_TouchPoint::isPressed = false bool OH_NativeXComponent_TouchPoint::isPressed = false
``` ```
**Description:** **描述:**
Whether the current point is pressed. 当前点是否被按下。
**自从:**
8
### numPoints ### numPoints
...@@ -354,9 +676,13 @@ Whether the current point is pressed. ...@@ -354,9 +676,13 @@ Whether the current point is pressed.
uint32_t OH_NativeXComponent_TouchEvent::numPoints = 0 uint32_t OH_NativeXComponent_TouchEvent::numPoints = 0
``` ```
**Description:** **描述:**
当前接触点的数量。
Number of current touch points. **自从:**
8
### OnSurfaceChanged ### OnSurfaceChanged
...@@ -366,9 +692,13 @@ Number of current touch points. ...@@ -366,9 +692,13 @@ Number of current touch points.
void(* OH_NativeXComponent_Callback::OnSurfaceChanged) (OH_NativeXComponent *component, void *window) void(* OH_NativeXComponent_Callback::OnSurfaceChanged) (OH_NativeXComponent *component, void *window)
``` ```
**Description:** **描述:**
当surface改变时调用。
Called when the surface is changed. This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. **自从:**
8
### OnSurfaceCreated ### OnSurfaceCreated
...@@ -378,9 +708,13 @@ Called when the surface is changed. This API is defined but not implemented in O ...@@ -378,9 +708,13 @@ Called when the surface is changed. This API is defined but not implemented in O
void(* OH_NativeXComponent_Callback::OnSurfaceCreated) (OH_NativeXComponent *component, void *window) void(* OH_NativeXComponent_Callback::OnSurfaceCreated) (OH_NativeXComponent *component, void *window)
``` ```
**Description:** **描述:**
Called when the surface is created. 创建surface时调用。
**自从:**
8
### OnSurfaceDestroyed ### OnSurfaceDestroyed
...@@ -390,57 +724,109 @@ Called when the surface is created. ...@@ -390,57 +724,109 @@ Called when the surface is created.
void(* OH_NativeXComponent_Callback::OnSurfaceDestroyed) (OH_NativeXComponent *component, void *window) void(* OH_NativeXComponent_Callback::OnSurfaceDestroyed) (OH_NativeXComponent *component, void *window)
``` ```
**Description:** **描述:**
Called when the surface is destroyed. 当surface被破坏时调用。
**自从:**
8
### screenX [1/2]
### screenX [1/3]
``` ```
float OH_NativeXComponent_TouchPoint::screenX = 0.0 float OH_NativeXComponent_TouchPoint::screenX = 0.0
``` ```
**Description:** **描述:**
触摸点相对于屏幕左边缘的x坐标。
X coordinate of the touch point relative to the left edge of the screen. **自从:**
8
### screenX [2/2]
### screenX [2/3]
``` ```
float OH_NativeXComponent_TouchEvent::screenX = 0.0 float OH_NativeXComponent_TouchEvent::screenX = 0.0
``` ```
**Description:** **描述:**
X coordinate of the touch point relative to the left edge of the screen. 触摸点相对于屏幕左边缘的x坐标。
**自从:**
### screenY [1/2] 8
### screenX [3/3]
```
float OH_NativeXComponent_MouseEvent::screenX
```
**描述:**
点击触点相对于屏幕左上角的x轴坐标。
**自从:**
8
### screenY [1/3]
``` ```
float OH_NativeXComponent_TouchPoint::screenY = 0.0 float OH_NativeXComponent_TouchPoint::screenY = 0.0
``` ```
**Description:** **描述:**
Y coordinate of the touch point relative to the upper edge of the screen. 触摸点相对于屏幕上边缘的y坐标。
**自从:**
### screenY [2/2] 8
### screenY [2/3]
``` ```
float OH_NativeXComponent_TouchEvent::screenY = 0.0 float OH_NativeXComponent_TouchEvent::screenY = 0.0
``` ```
**Description:** **描述:**
触摸点相对于屏幕上边缘的y坐标。
**自从:**
8
### screenY [3/3]
```
float OH_NativeXComponent_MouseEvent::screenY
```
**描述:**
Y coordinate of the touch point relative to the upper edge of the screen. 点击触点相对于屏幕左上角的y轴坐标。
**自从:**
8
### size [1/2] ### size [1/2]
...@@ -450,9 +836,13 @@ Y coordinate of the touch point relative to the upper edge of the screen. ...@@ -450,9 +836,13 @@ Y coordinate of the touch point relative to the upper edge of the screen.
double OH_NativeXComponent_TouchPoint::size = 0.0 double OH_NativeXComponent_TouchPoint::size = 0.0
``` ```
**Description:** **描述:**
Contact area between the finger pad and the screen. 指垫和屏幕之间的接触面积。
**自从:**
8
### size [2/2] ### size [2/2]
...@@ -462,9 +852,13 @@ Contact area between the finger pad and the screen. ...@@ -462,9 +852,13 @@ Contact area between the finger pad and the screen.
double OH_NativeXComponent_TouchEvent::size = 0.0 double OH_NativeXComponent_TouchEvent::size = 0.0
``` ```
**Description:** **描述:**
指垫和屏幕之间的接触面积。
Contact area between the finger pad and the screen. **自从:**
8
### timeStamp [1/2] ### timeStamp [1/2]
...@@ -474,9 +868,13 @@ Contact area between the finger pad and the screen. ...@@ -474,9 +868,13 @@ Contact area between the finger pad and the screen.
long long OH_NativeXComponent_TouchPoint::timeStamp = 0 long long OH_NativeXComponent_TouchPoint::timeStamp = 0
``` ```
**Description:** **描述:**
Timestamp of the current touch event. 当前触摸事件的时间戳。
**自从:**
8
### timeStamp [2/2] ### timeStamp [2/2]
...@@ -486,9 +884,29 @@ Timestamp of the current touch event. ...@@ -486,9 +884,29 @@ Timestamp of the current touch event.
long long OH_NativeXComponent_TouchEvent::timeStamp = 0 long long OH_NativeXComponent_TouchEvent::timeStamp = 0
``` ```
**Description:** **描述:**
Timestamp of the current touch event. 当前触摸事件的时间戳。
**自从:**
8
### timestamp
```
int64_t OH_NativeXComponent_MouseEvent::timestamp
```
**描述:**
当前鼠标事件的时间戳
**自从:**
8
### touchPoints ### touchPoints
...@@ -498,9 +916,13 @@ Timestamp of the current touch event. ...@@ -498,9 +916,13 @@ Timestamp of the current touch event.
OH_NativeXComponent_TouchPoint OH_NativeXComponent_TouchEvent::touchPoints[OH_MAX_TOUCH_POINTS_NUMBER] OH_NativeXComponent_TouchPoint OH_NativeXComponent_TouchEvent::touchPoints[OH_MAX_TOUCH_POINTS_NUMBER]
``` ```
**Description:** **描述:**
Array of the current touch points. 当前触摸点的数组。
**自从:**
8
### type [1/2] ### type [1/2]
...@@ -510,9 +932,13 @@ Array of the current touch points. ...@@ -510,9 +932,13 @@ Array of the current touch points.
OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchPoint::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchPoint::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN
``` ```
**Description:** **描述:**
触摸事件的触摸类型。
Touch type of the touch event. **自从:**
8
### type [2/2] ### type [2/2]
...@@ -522,54 +948,106 @@ Touch type of the touch event. ...@@ -522,54 +948,106 @@ Touch type of the touch event.
OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchEvent::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchEvent::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN
``` ```
**Description:** **描述:**
Touch type of the touch event. 触摸事件的触摸类型。
**自从:**
### x [1/2] 8
### x [1/3]
``` ```
float OH_NativeXComponent_TouchPoint::x = 0.0 float OH_NativeXComponent_TouchPoint::x = 0.0
``` ```
**Description:** **描述:**
触摸点相对于XComponent组件左边缘的x坐标。
**自从:**
X coordinate of the touch point relative to the left edge of the element to touch. 8
### x [2/2] ### x [2/3]
``` ```
float OH_NativeXComponent_TouchEvent::x = 0.0 float OH_NativeXComponent_TouchEvent::x = 0.0
``` ```
**Description:** **描述:**
触摸点相对于XComponent组件左边缘的x坐标。
X coordinate of the touch point relative to the left edge of the element to touch. **自从:**
8
### y [1/2]
### x [3/3]
```
float OH_NativeXComponent_MouseEvent::x
```
**描述:**
点击触点相对于当前组件左上角的x轴坐标。
**自从:**
8
### y [1/3]
``` ```
float OH_NativeXComponent_TouchPoint::y = 0.0 float OH_NativeXComponent_TouchPoint::y = 0.0
``` ```
**Description:** **描述:**
触摸点相对于XComponent组件上边缘的y坐标。
Y coordinate of the touch point relative to the upper edge of the element to touch. **自从:**
8
### y [2/2]
### y [2/3]
``` ```
float OH_NativeXComponent_TouchEvent::y = 0.0 float OH_NativeXComponent_TouchEvent::y = 0.0
``` ```
**Description:** **描述:**
触摸点相对于XComponent组件上边缘的y坐标。
**自从:**
8
### y [3/3]
```
float OH_NativeXComponent_MouseEvent::y
```
**描述:**
点击触点相对于当前组件左上角的y轴坐标。
Y coordinate of the touch point relative to the upper edge of the element to touch. **自从:**
8
# OH_NativeXComponent_Callback # OH_NativeXComponent_Callback
## **Overview** ## 概述
**Related Modules:** 注册surface生命周期和触摸事件回调。
[Native XComponent](_o_h___native_x_component.md) **自从:**
**Description:** 8
Registers the surface lifecycle and touch event callbacks. **相关模块:**
[Native XComponent](_o_h___native_x_component.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Public Attributes ### 成员变量
| Public&nbsp;Attribute&nbsp;Name | Description | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OnSurfaceCreated](_o_h___native_x_component.md#ga8beefd4b2359680a3106b28227e47d00)&nbsp;)([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;void&nbsp;\*window) | | | [OnSurfaceCreated](_o_h___native_x_component.md#onsurfacecreated) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, void \*window) | 创建surface时调用。 |
| [OnSurfaceChanged](_o_h___native_x_component.md#ga7d84244e13477d91cfdade8d9ff8565b)&nbsp;)([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;void&nbsp;\*window) | | | [OnSurfaceChanged](_o_h___native_x_component.md#onsurfacechanged) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, void \*window) | 当surface改变时调用。 |
| [OnSurfaceDestroyed](_o_h___native_x_component.md#gad32bd08c749422d807ac87c558af6a44)&nbsp;)([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;void&nbsp;\*window) | | | [OnSurfaceDestroyed](_o_h___native_x_component.md#onsurfacedestroyed) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, void \*window) | 当surface被破坏时调用。 |
| [DispatchTouchEvent](_o_h___native_x_component.md#ga3d40ca63aba381a63435f71f679e1f26)&nbsp;)([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;void&nbsp;\*window) | | | [DispatchTouchEvent](_o_h___native_x_component.md#dispatchtouchevent) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, void \*window) | 当触摸事件被触发时调用。 |
# OH_NativeXComponent_MouseEvent
## 概述
鼠标事件。
**自从:**
9
**相关模块:**
[Native XComponent](_o_h___native_x_component.md)
## 汇总
### 成员变量
| 成员变量名称 | 描述 |
| -------- | -------- |
| [x](_o_h___native_x_component.md#x-33) | 点击触点相对于当前组件左上角的x轴坐标。 |
| [y](_o_h___native_x_component.md#y-33) | 点击触点相对于当前组件左上角的y轴坐标。 |
| [screenX](_o_h___native_x_component.md#screenx-33) | 点击触点相对于屏幕左上角的x轴坐标。 |
| [screenY](_o_h___native_x_component.md#screeny-33) | 点击触点相对于屏幕左上角的y轴坐标。 |
| [timestamp](_o_h___native_x_component.md#timestamp) | 当前鼠标事件的时间戳。 |
| [action](_o_h___native_x_component.md#action) | 当前鼠标事件动作。 |
| [button](_o_h___native_x_component.md#button) | 鼠标事件按键。 |
# OH_NativeXComponent_MouseEvent_Callback
## 概述
注册鼠标事件的回调。
**自从:**
9
**相关模块:**
[Native XComponent](_o_h___native_x_component.md)
## 汇总
### 成员变量
| 成员变量名称 | 描述 |
| -------- | -------- |
| [DispatchMouseEvent](_o_h___native_x_component.md#dispatchmouseevent) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, void \*window) | 当鼠标事件被触发时调用。 |
| [DispatchHoverEvent](_o_h___native_x_component.md#dispatchhoverevent) )([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, bool isHover) | 当悬停事件被触发时调用。 |
# OH_NativeXComponent_TouchEvent # OH_NativeXComponent_TouchEvent
## **Overview** ## 概述
**Related Modules:** 触摸事件。
**自从:**
8
**相关模块:**
[Native XComponent](_o_h___native_x_component.md) [Native XComponent](_o_h___native_x_component.md)
## **Summary** ## 汇总
### Public Attributes ### 成员变量
| Public&nbsp;Attribute&nbsp;Name | Description | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [id](_o_h___native_x_component.md#gac986c10f386a0b55bd813caec06fe190)&nbsp;=&nbsp;0 | | | [id](_o_h___native_x_component.md#id-22) = 0 | 手指的唯一标识符。 |
| [screenX](_o_h___native_x_component.md#ga68fe9ff656e74ae14254523443d85bb1)&nbsp;=&nbsp;0.0 | | | [screenX](_o_h___native_x_component.md#screenx-23) = 0.0 | 触摸点相对于屏幕左边缘的x坐标。 |
| [screenY](_o_h___native_x_component.md#ga7696e0e1a81787400e187058a1e332f2)&nbsp;=&nbsp;0.0 | | | [screenY](_o_h___native_x_component.md#screeny-23) = 0.0 | 触摸点相对于屏幕上边缘的y坐标。 |
| [x](_o_h___native_x_component.md#ga9688a76d25bede284e36b7226ec8ad3a)&nbsp;=&nbsp;0.0 | | | [x](_o_h___native_x_component.md#x-23) = 0.0 | 触摸点相对于XComponent组件左边缘的x坐标。 |
| [y](_o_h___native_x_component.md#ga0136d85dae638fbe9baaa69cf67a9833)&nbsp;=&nbsp;0.0 | | | [y](_o_h___native_x_component.md#y-23) = 0.0 | 触摸点相对于XComponent组件上边缘的y坐标。 |
| [type](_o_h___native_x_component.md#ga22f67143e6acdefa5c7fd4ba23f7c2b6)&nbsp;=&nbsp;[OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182aff39d23c1412b3b110a19df4893651d3) | | | [type](_o_h___native_x_component.md#type-22) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | 触摸事件的触摸类型。 |
| [size](_o_h___native_x_component.md#ga723601b60610b546fbdaf29e87575ca2)&nbsp;=&nbsp;0.0 | | | [size](_o_h___native_x_component.md#size-22) = 0.0 | 指垫和屏幕之间的接触面积。 |
| [force](_o_h___native_x_component.md#ga7c0a450a47231bd55994a970b3750d3f)&nbsp;=&nbsp;0.0 | | | [force](_o_h___native_x_component.md#force-22) = 0.0 | 当前触摸事件的压力。 |
| [deviceId](_o_h___native_x_component.md#ga00660bb31b05cebe8964ba221c24f966)&nbsp;=&nbsp;0 | | | [deviceId](_o_h___native_x_component.md#deviceid) = 0 | 产生当前触摸事件的设备的ID。 |
| [timeStamp](_o_h___native_x_component.md#gadd872bda25d5af9327d12d06a70149fd)&nbsp;=&nbsp;0 | | | [timeStamp](_o_h___native_x_component.md#timestamp-22) = 0 | 当前触摸事件的时间戳。 |
| [touchPoints](_o_h___native_x_component.md#gab3514bf8d2fa3de8191d4898ee739053)&nbsp;[OH_MAX_TOUCH_POINTS_NUMBER] | | | [touchPoints](_o_h___native_x_component.md#touchpoints) [OH_MAX_TOUCH_POINTS_NUMBER] | 当前触摸点的数组。 |
| [numPoints](_o_h___native_x_component.md#gad8c19c6c2bbb367fa18fffa813e21cc6)&nbsp;=&nbsp;0 | | | [numPoints](_o_h___native_x_component.md#numpoints) = 0 | 当前接触点的数量。 |
# OH_NativeXComponent_TouchPoint # OH_NativeXComponent_TouchPoint
## **Overview** ## 概述
**Related Modules:** 触摸事件中触摸点的信息。
**自从:**
8
**相关模块:**
[Native XComponent](_o_h___native_x_component.md) [Native XComponent](_o_h___native_x_component.md)
## **Summary** ## 汇总
### Public Attributes ### 成员变量
| Public&nbsp;Attribute&nbsp;Name | Description | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [id](_o_h___native_x_component.md#gafc435f3e8b5acf462b28bae69180d971)&nbsp;=&nbsp;0 | | | [id](_o_h___native_x_component.md#id-12) = 0 | 手指的唯一标识符。 |
| [screenX](_o_h___native_x_component.md#gae96f097ddffb119b824bcd9f59857ea4)&nbsp;=&nbsp;0.0 | | | [screenX](_o_h___native_x_component.md#screenx-13) = 0.0 | 触摸点相对于屏幕左边缘的x坐标。 |
| [screenY](_o_h___native_x_component.md#ga8fb126875104358f84e17ddd66dbbf60)&nbsp;=&nbsp;0.0 | | | [screenY](_o_h___native_x_component.md#screeny-13) = 0.0 | 触摸点相对于屏幕上边缘的y坐标。 |
| [x](_o_h___native_x_component.md#ga04e0e65a35a652d86460c82bf0ca02e3)&nbsp;=&nbsp;0.0 | | | [x](_o_h___native_x_component.md#x-13) = 0.0 | 触摸点相对于XComponent组件左边缘的x坐标。 |
| [y](_o_h___native_x_component.md#ga13d254769a362f049243505e84df8fa4)&nbsp;=&nbsp;0.0 | | | [y](_o_h___native_x_component.md#y-13) = 0.0 | 触摸点相对于XComponent组件上边缘的y坐标。 |
| [type](_o_h___native_x_component.md#gac2b852641112bce8de71f080a21a118a)&nbsp;=&nbsp;[OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182aff39d23c1412b3b110a19df4893651d3) | | | [type](_o_h___native_x_component.md#type-12) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | 触摸事件的触摸类型。 |
| [size](_o_h___native_x_component.md#ga9e5a0e118ab61a889126a985be7947dd)&nbsp;=&nbsp;0.0 | | | [size](_o_h___native_x_component.md#size-12) = 0.0 | 指垫和屏幕之间的接触面积。 |
| [force](_o_h___native_x_component.md#gaf3d4f92022552678d5d81d2396900595)&nbsp;=&nbsp;0.0 | | | [force](_o_h___native_x_component.md#force-12) = 0.0 | 当前触摸事件的压力。 |
| [timeStamp](_o_h___native_x_component.md#gad090e826a0e33a4054f468109a5a729d)&nbsp;=&nbsp;0 | | | [timeStamp](_o_h___native_x_component.md#timestamp-12) = 0 | 当前触摸事件的时间戳。 |
| [isPressed](_o_h___native_x_component.md#ga527c92deb88977ae842ffe6fee50d571)&nbsp;=&nbsp;false | | | [isPressed](_o_h___native_x_component.md#ispressed) = false | 当前点是否被按下。 |
# OhosPixelMapInfo
## 概述
用于定义 pixel map 的相关信息。
**自从:**
8
**相关模块:**
[Image](image.md)
## 汇总
### 成员变量
| 成员变量名称 | 描述 |
| -------- | -------- |
| [width](#width) | 图片的高,用pixels表示。 |
| [height](#height) | Pixel的格式。 |
| [rowSize](#rowsize) | 每行的bytes数。 |
| [pixelFormat](#pixelformat) | 图片的宽,用pixels表示。 |
## 结构体成员变量说明
### height
```
uint32_t OhosPixelMapInfo::height
```
**描述:**
图片的高,用pixels表示。
### pixelFormat
```
int32_t OhosPixelMapInfo::pixelFormat
```
**描述:**
Pixel的格式。
### rowSize
```
uint32_t OhosPixelMapInfo::rowSize
```
**描述:**
每行的bytes数。
### width
```
uint32_t OhosPixelMapInfo::width
```
**描述:**
图片的宽,用pixels表示。
# RawFileDescriptor # RawFileDescriptor
## **Overview** ## 概述
**Related Modules:** 提供rawfile文件描述符信息。
[Rawfile](rawfile.md) RawFileDescriptor是[OH_ResourceManager_GetRawFileDescriptor()](rawfile.md#oh_resourcemanager_getrawfiledescriptor)的输出参数,涵盖了rawfile文件的文件描述符以及在HAP包中的起始位置和长度。
**Description:**
提供rawfile文件描述符信息
RawFileDescriptor是[OH_ResourceManager_GetRawFileDescriptor](rawfile.md#ga8313a7d4bb361a98ced485346a9be4b1)的输出参数, 涵盖了rawfile文件的文件描述符以及在HAP包中的起始位置和长度。
**Since:** **自从:**
8 8
**Version:** **相关模块:**
1.0 [Rawfile](rawfile.md)
## **Summary** ## 汇总
### Public Attributes ### 成员变量
| Public&nbsp;Attribute&nbsp;Name | Description | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| fd | | | [fd](#fd) | rawfile文件描述符 |
| start | | | [start](#start) | rawfile在HAP包中的长度 |
| length | | | [length](#length) | rawfile在HAP包中的起始位置 |
## **Details**
## **Member Data** ## 结构体成员变量说明
### fd ### fd
...@@ -47,7 +38,7 @@ RawFileDescriptor是[OH_ResourceManager_GetRawFileDescriptor](rawfile.md#ga8313a ...@@ -47,7 +38,7 @@ RawFileDescriptor是[OH_ResourceManager_GetRawFileDescriptor](rawfile.md#ga8313a
int RawFileDescriptor::fd int RawFileDescriptor::fd
``` ```
**Description:** **描述:**
rawfile文件描述符 rawfile文件描述符
...@@ -59,7 +50,7 @@ rawfile文件描述符 ...@@ -59,7 +50,7 @@ rawfile文件描述符
long RawFileDescriptor::length long RawFileDescriptor::length
``` ```
**Description:** **描述:**
rawfile在HAP包中的长度 rawfile在HAP包中的长度
...@@ -71,6 +62,6 @@ rawfile在HAP包中的长度 ...@@ -71,6 +62,6 @@ rawfile在HAP包中的长度
long RawFileDescriptor::start long RawFileDescriptor::start
``` ```
**Description:** **描述:**
rawfile在HAP包中的起始位置 rawfile在HAP包中的起始位置
# drawing_bitmap.h # drawing_bitmap.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与位图相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与位图相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Classes ### 结构体
| Classes&nbsp;Name | Description | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 结构体用于描述位图像素的格式,包括颜色类型和透明度类型 | | [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | 结构体用于描述位图像素的格式,包括颜色类型和透明度类型 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_BitmapCreate](_drawing.md#gac2d33ba4b18e71eca8c41c136004ba48)&nbsp;(void) | [OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*<br/>函数用于创建一个位图对象。 | | [OH_Drawing_BitmapCreate](_drawing.md#oh_drawing_bitmapcreate) (void) | 函数用于创建一个位图对象。 |
| [OH_Drawing_BitmapDestroy](_drawing.md#ga5c31becccf1d3ad5df5f6bc7d9007b8f)&nbsp;([OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*) | void<br/>函数用于销毁位图对象并回收该对象占有内存。 | | [OH_Drawing_BitmapDestroy](_drawing.md#oh_drawing_bitmapdestroy) ([OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*) | 函数用于销毁位图对象并回收该对象占有内存。 |
| [OH_Drawing_BitmapBuild](_drawing.md#ga699afe9c4d2665cdd21b5d9b6dfed2ec)&nbsp;([OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*,&nbsp;const&nbsp;uint32_t&nbsp;width,&nbsp;const&nbsp;uint32_t&nbsp;height,&nbsp;const&nbsp;[OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md)&nbsp;\*) | void<br/>函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式 | | [OH_Drawing_BitmapBuild](_drawing.md#oh_drawing_bitmapbuild) ([OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*, const uint32_t width, const uint32_t height, const [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) \*) | 函数用于初始化位图对象的宽度和高度,并且为该位图设置像素格式 |
| [OH_Drawing_BitmapGetWidth](_drawing.md#ga67b83650847ab1f6e79ca122905d55a3)&nbsp;([OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*) | uint32_t<br/>该函数用于获取指定位图的宽度 | | [OH_Drawing_BitmapGetWidth](_drawing.md#oh_drawing_bitmapgetwidth) ([OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*) | 该函数用于获取指定位图的宽度 |
| [OH_Drawing_BitmapGetHeight](_drawing.md#gace471d69bec5b152bd4de5fa8504f7fd)&nbsp;([OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*) | uint32_t<br/>函数用于获取指定位图的高度 | | [OH_Drawing_BitmapGetHeight](_drawing.md#oh_drawing_bitmapgetheight) ([OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*) | 函数用于获取指定位图的高度 |
| [OH_Drawing_BitmapGetPixels](_drawing.md#gaf007f52cfbcbc63cd02971c6480c55fb)&nbsp;([OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*) | void&nbsp;\*<br/>函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据 | | [OH_Drawing_BitmapGetPixels](_drawing.md#oh_drawing_bitmapgetpixels) ([OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*) | 函数用于获取指定位图的像素地址,可以通过像素地址获取到位图的像素数据 |
# drawing_brush.h # drawing_brush.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与画刷相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与画刷相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_BrushCreate](_drawing.md#ga75e2193d23cf75878c7b2c78d6b23b35)&nbsp;(void) | [OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*<br/>函数用于创建一个画刷对象 | | [OH_Drawing_BrushCreate](_drawing.md#oh_drawing_brushcreate) (void) | 函数用于创建一个画刷对象 |
| [OH_Drawing_BrushDestroy](_drawing.md#ga9dc1d4aa465d06f2d847feddae1558b5)&nbsp;([OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*) | void<br/>函数用于销毁画刷对象并回收该对象占有的内存。 | | [OH_Drawing_BrushDestroy](_drawing.md#oh_drawing_brushdestroy) ([OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*) | 函数用于销毁画刷对象并回收该对象占有的内存。 |
| [OH_Drawing_BrushIsAntiAlias](_drawing.md#ga4c861e23b8c0a3fb84d906d81bea5335)&nbsp;(const&nbsp;[OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*) | bool<br/>函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_BrushIsAntiAlias](_drawing.md#oh_drawing_brushisantialias) (const [OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*) | 函数用于获取画刷是否设置抗锯齿属性,如果为真则说明画刷会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 |
| [OH_Drawing_BrushSetAntiAlias](_drawing.md#ga41735fc7a2776fbe41c77b3f4637e1c5)&nbsp;([OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*,&nbsp;bool) | void<br/>函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_BrushSetAntiAlias](_drawing.md#oh_drawing_brushsetantialias) ([OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*, bool) | 函数用于设置画刷的抗锯齿属性,设置为真则画刷在绘制图形时会对图形的边缘像素进行半透明的模糊处理 |
| [OH_Drawing_BrushGetColor](_drawing.md#ga29dc1e2442cea7e958a5e037c4cc9f59)&nbsp;(const&nbsp;[OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*) | uint32_t<br/>函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_BrushGetColor](_drawing.md#oh_drawing_brushgetcolor) (const [OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*) | 函数用于获取画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 |
| [OH_Drawing_BrushSetColor](_drawing.md#ga4b62aa574623c1a75e14f612a831531b)&nbsp;([OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_BrushSetColor](_drawing.md#oh_drawing_brushsetcolor) ([OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*, uint32_t color) | 函数用于设置画刷的颜色属性,颜色属性描述了画刷填充图形时使用的颜色,用一个32位(ARGB)的变量表示 |
# drawing_canvas.h # drawing_canvas.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与画布相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与画布相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_CanvasCreate](_drawing.md#ga1bfe881a0b018a982678906f3522d4df)&nbsp;(void) | [OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*<br/>函数用于创建一个画布对象 | | [OH_Drawing_CanvasCreate](_drawing.md#oh_drawing_canvascreate) (void) | 函数用于创建一个画布对象 |
| [OH_Drawing_CanvasDestroy](_drawing.md#ga1a3023ccc48a381cc0b4ae09e2d85c38)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*) | void<br/>函数用于销毁画布对象并回收该对象占有的内存 | | [OH_Drawing_CanvasDestroy](_drawing.md#oh_drawing_canvasdestroy) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*) | 函数用于销毁画布对象并回收该对象占有的内存 |
| [OH_Drawing_CanvasBind](_drawing.md#ga666595bb182a5e31733f4144c1515cae)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;[OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)&nbsp;\*) | void<br/>函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染) | | [OH_Drawing_CanvasBind](_drawing.md#oh_drawing_canvasbind) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) \*) | 函数用于将一个位图对象绑定到画布中,使得画布绘制的内容输出到位图中(即CPU渲染) |
| [OH_Drawing_CanvasAttachPen](_drawing.md#gaaec6db563bd7153dc95d0bfab71a4ed1)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | void<br/>函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓 | | [OH_Drawing_CanvasAttachPen](_drawing.md#oh_drawing_canvasattachpen) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于设置画笔给画布,画布将会使用设置画笔的样式和颜色去绘制图形形状的轮廓 |
| [OH_Drawing_CanvasDetachPen](_drawing.md#ga79321b669f2b5dc0460ca929f00dfc47)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*) | void<br/>函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓 | | [OH_Drawing_CanvasDetachPen](_drawing.md#oh_drawing_canvasdetachpen) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*) | 函数用于去除掉画布中的画笔,使用后画布将不去绘制图形形状的轮廓 |
| [OH_Drawing_CanvasAttachBrush](_drawing.md#ga1b238c829ea5f2ff627766a3e50feaa6)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;const&nbsp;[OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)&nbsp;\*) | void<br/>函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状 | | [OH_Drawing_CanvasAttachBrush](_drawing.md#oh_drawing_canvasattachbrush) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, const [OH_Drawing_Brush](_drawing.md#oh_drawing_brush) \*) | 函数用于设置画刷给画布,画布将会使用设置的画刷样式和颜色去填充绘制的图形形状 |
| [OH_Drawing_CanvasDetachBrush](_drawing.md#ga7a6b5e56d2492b5641b8b3f634b096fe)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*) | void<br/>函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状 | | [OH_Drawing_CanvasDetachBrush](_drawing.md#oh_drawing_canvasdetachbrush) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*) | 函数用于去除掉画布中的画刷,使用后画布将不去填充图形形状 |
| [OH_Drawing_CanvasSave](_drawing.md#ga4ebc55405e00ad4b8609303fefc6997a)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*) | void<br/>函数用于保存当前画布的状态(画布矩阵)到一个栈顶 | | [OH_Drawing_CanvasSave](_drawing.md#oh_drawing_canvassave) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*) | 函数用于保存当前画布的状态(画布矩阵)到一个栈顶 |
| [OH_Drawing_CanvasRestore](_drawing.md#gadd632be64ccc2601def753ecc1e53944)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*) | void<br/>函数用于恢复保存在栈顶的画布状态(画布矩阵) | | [OH_Drawing_CanvasRestore](_drawing.md#oh_drawing_canvasrestore) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*) | 函数用于恢复保存在栈顶的画布状态(画布矩阵) |
| [OH_Drawing_CanvasDrawLine](_drawing.md#gadf6bae5efd20587612596f8e78a16144)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;float&nbsp;x1,&nbsp;float&nbsp;y1,&nbsp;float&nbsp;x2,&nbsp;float&nbsp;y2) | void<br/>函数用于画一条直线段 | | [OH_Drawing_CanvasDrawLine](_drawing.md#oh_drawing_canvasdrawline) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, float x1, float y1, float x2, float y2) | 函数用于画一条直线段 |
| [OH_Drawing_CanvasDrawPath](_drawing.md#ga99ebc73abdc27599f4bcc1c1045cb75e)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;const&nbsp;[OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*) | void<br/>函数用于画一个自定义路径 | | [OH_Drawing_CanvasDrawPath](_drawing.md#oh_drawing_canvasdrawpath) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, const [OH_Drawing_Path](_drawing.md#oh_drawing_path) \*) | 函数用于画一个自定义路径 |
| [OH_Drawing_CanvasClear](_drawing.md#ga7f07cc6f0b223d9b343c133fbb2503f6)&nbsp;([OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于使用指定颜色去清空画布 | | [OH_Drawing_CanvasClear](_drawing.md#oh_drawing_canvasclear) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, uint32_t color) | 函数用于使用指定颜色去清空画布 |
# drawing_color.h # drawing_color.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与颜色相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与颜色相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_ColorSetArgb](_drawing.md#ga9137935b970e49ffd813157ebd8bbfb7)&nbsp;(uint32_t&nbsp;alpha,&nbsp;uint32_t&nbsp;red,&nbsp;uint32_t&nbsp;green,&nbsp;uint32_t&nbsp;blue) | uint32_t<br/>函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量 | | [OH_Drawing_ColorSetArgb](_drawing.md#oh_drawing_colorsetargb) (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue) | 函数用于将4个变量(分别描述透明度、红色、绿色和蓝色)转化为一个描述颜色的32位(ARGB)变量 |
# drawing_font_collection.h # drawing_font_collection.h
## **Overview** ## 概述
**Related Modules:** 定义绘制模块中与fontCollection相关的函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
定义绘制模块中与fontCollection相关的函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_CreateFontCollection](_drawing.md#gab54c68359a650cde36b82f021f06c814)&nbsp;(void) | [OH_Drawing_FontCollection](_drawing.md#ga4ce31d04a1580d4f50e87b8695fcebc7)&nbsp;\*<br/>创建OH_Drawing_FontCollection | | [OH_Drawing_CreateFontCollection](_drawing.md#oh_drawing_createfontcollection) (void) | 创建OH_Drawing_FontCollection |
| [OH_Drawing_DestroyFontCollection](_drawing.md#ga4791ce4ddfaa3545a797c2ce144c819d)&nbsp;([OH_Drawing_FontCollection](_drawing.md#ga4ce31d04a1580d4f50e87b8695fcebc7)&nbsp;\*) | void<br/>释放被OH_Drawing_FontCollection对象占据的内存 | | [OH_Drawing_DestroyFontCollection](_drawing.md#oh_drawing_destroyfontcollection) ([OH_Drawing_FontCollection](_drawing.md#oh_drawing_fontcollection) \*) | 释放被OH_Drawing_FontCollection对象占据的内存 |
# drawing_path.h # drawing_path.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与自定义路径相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与自定义路径相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_PathCreate](_drawing.md#ga379fcebc6b43c3b90e0933d928d7c890)&nbsp;(void) | [OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*<br/>函数用于创建一个路径对象 | | [OH_Drawing_PathCreate](_drawing.md#oh_drawing_pathcreate) (void) | 函数用于创建一个路径对象 |
| [OH_Drawing_PathDestroy](_drawing.md#gaa5961e76fd8d2aacdd1fe94ad354ba51)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*) | void<br/>函数用于销毁路径对象并回收该对象占有的内存 | | [OH_Drawing_PathDestroy](_drawing.md#oh_drawing_pathdestroy) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*) | 函数用于销毁路径对象并回收该对象占有的内存 |
| [OH_Drawing_PathMoveTo](_drawing.md#ga3934f53ce94644feaa79fb96bc7fbcc9)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*,&nbsp;float&nbsp;x,&nbsp;float&nbsp;y) | void<br/>函数用于设置自定义路径的起始点位置 | | [OH_Drawing_PathMoveTo](_drawing.md#oh_drawing_pathmoveto) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*, float x, float y) | 函数用于设置自定义路径的起始点位置 |
| [OH_Drawing_PathLineTo](_drawing.md#ga4da6ed28d5db091be54af8efe661eb18)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*,&nbsp;float&nbsp;x,&nbsp;float&nbsp;y) | void<br/>函数用于添加一条从路径的最后点位置到目标点位置的线段 | | [OH_Drawing_PathLineTo](_drawing.md#oh_drawing_pathlineto) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*, float x, float y) | 函数用于添加一条从路径的最后点位置到目标点位置的线段 |
| [OH_Drawing_PathArcTo](_drawing.md#ga33c44796dfe8050dad3e6306f66ba0d3)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*,&nbsp;float&nbsp;x1,&nbsp;float&nbsp;y1,&nbsp;float&nbsp;x2,&nbsp;float&nbsp;y2,&nbsp;float&nbsp;startDeg,&nbsp;float&nbsp;sweepDeg) | void<br/>函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆,&nbsp;然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段 | | [OH_Drawing_PathArcTo](_drawing.md#oh_drawing_patharcto) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) | 函数用于给路径添加一段弧线,绘制弧线的方式为角度弧,该方式首先会指定一个矩形边框,矩形边框会包裹椭圆, 然后会指定一个起始角度和扫描度数,从起始角度扫描截取的椭圆周长一部分即为绘制的弧线。另外会默认添加一条从路径的最后点位置到弧线起始点位置的线段 |
| [OH_Drawing_PathQuadTo](_drawing.md#ga5f69a50c045822c5d5d4896bc120318b)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*,&nbsp;float&nbsp;ctrlX,&nbsp;float&nbsp;ctrlY,&nbsp;float&nbsp;endX,&nbsp;float&nbsp;endY) | void<br/>函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线 | | [OH_Drawing_PathQuadTo](_drawing.md#oh_drawing_pathquadto) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | 函数用于添加一条从路径最后点位置到目标点位置的二阶贝塞尔圆滑曲线 |
| [OH_Drawing_PathCubicTo](_drawing.md#ga6a84a20af7911dc504696402c357f1be)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*,&nbsp;float&nbsp;ctrlX1,&nbsp;float&nbsp;ctrlY1,&nbsp;float&nbsp;ctrlX2,&nbsp;float&nbsp;ctrlY2,&nbsp;float&nbsp;endX,&nbsp;float&nbsp;endY) | void<br/>函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线 | | [OH_Drawing_PathCubicTo](_drawing.md#oh_drawing_pathcubicto) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | 函数用于添加一条从路径最后点位置到目标点位置的三阶贝塞尔圆滑曲线 |
| [OH_Drawing_PathClose](_drawing.md#ga7a3be11857364cdf2e6ca1af70917816)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*) | void<br/>函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段 | | [OH_Drawing_PathClose](_drawing.md#oh_drawing_pathclose) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*) | 函数用于闭合路径,会添加一条从路径起点位置到最后点位置的线段 |
| [OH_Drawing_PathReset](_drawing.md#gaf907c525b05dbd1355d16dc13b4ccda9)&nbsp;([OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)&nbsp;\*) | void<br/>函数用于重置自定义路径数据 | | [OH_Drawing_PathReset](_drawing.md#oh_drawing_pathreset) ([OH_Drawing_Path](_drawing.md#oh_drawing_path) \*) | 函数用于重置自定义路径数据 |
# drawing_pen.h # drawing_pen.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了与画笔相关的功能函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了与画笔相关的功能函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Enumerations ### 枚举
| Enumeration&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_PenLineCapStyle](_drawing.md#gafa9d815d933e0fd6aa7549d12080fa8f)&nbsp;{&nbsp;[LINE_FLAT_CAP](_drawing.md#ggafa9d815d933e0fd6aa7549d12080fa8fa99c48cc6172088f1a86e8688e347933a),&nbsp;[LINE_SQUARE_CAP](_drawing.md#ggafa9d815d933e0fd6aa7549d12080fa8fac9929c30114c046b75b844e459f1e69f),&nbsp;[LINE_ROUND_CAP](_drawing.md#ggafa9d815d933e0fd6aa7549d12080fa8fa0efe3fb7b56d7407737c42aebe5b91e5)&nbsp;} | 枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式 | | [OH_Drawing_PenLineCapStyle](_drawing.md#oh_drawing_penlinecapstyle) { LINE_FLAT_CAP, LINE_SQUARE_CAP, LINE_ROUND_CAP } | 枚举集合定义了画笔笔帽的样式,即画笔在绘制线段时,在线段头尾端点的样式 |
| [OH_Drawing_PenLineJoinStyle](_drawing.md#gad10001f23f6c42f97a392cba30011460)&nbsp;{&nbsp;[LINE_MITER_JOIN](_drawing.md#ggad10001f23f6c42f97a392cba30011460a126e5fbae0f63b8431d3a6763035d488),&nbsp;[LINE_ROUND_JOIN](_drawing.md#ggad10001f23f6c42f97a392cba30011460aa2bfcc7c744ab7a56c047942060ad3ba),&nbsp;[LINE_BEVEL_JOIN](_drawing.md#ggad10001f23f6c42f97a392cba30011460a8ad7df33f8ff73c5c080fcf159631fde)&nbsp;} | 枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式 | | [OH_Drawing_PenLineJoinStyle](_drawing.md#oh_drawing_penlinejoinstyle) { LINE_MITER_JOIN, LINE_ROUND_JOIN, LINE_BEVEL_JOIN } | 枚举集合定义了线条转角的样式,即画笔在绘制折线段时,在折线转角处的样式 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_PenCreate](_drawing.md#gae52fe4132b90726d813661750948e2dd)&nbsp;(void) | [OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*<br/>函数用于创建一个画笔对象 | | [OH_Drawing_PenCreate](_drawing.md#oh_drawing_pencreate) (void) | 函数用于创建一个画笔对象 |
| [OH_Drawing_PenDestroy](_drawing.md#ga907538d02a50836e8033a3f7bf12c80e)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | void<br/>函数用于销毁画笔对象并回收该对象占有的内存 | | [OH_Drawing_PenDestroy](_drawing.md#oh_drawing_pendestroy) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于销毁画笔对象并回收该对象占有的内存 |
| [OH_Drawing_PenIsAntiAlias](_drawing.md#ga31dee499a3d1dd81e526bcc1dd620961)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | bool<br/>函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_PenIsAntiAlias](_drawing.md#oh_drawing_penisantialias) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取画笔是否设置抗锯齿属性,如果为真则说明画笔会启用抗锯齿功能,在绘制图形时会对图形的边缘像素进行半透明的模糊处理 |
| [OH_Drawing_PenSetAntiAlias](_drawing.md#ga93dbc44cf424038a17ae311920550283)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;bool) | void<br/>函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理 | | [OH_Drawing_PenSetAntiAlias](_drawing.md#oh_drawing_pensetantialias) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, bool) | 函数用于设置画笔的抗锯齿属性,设置为真则画笔在绘制图形时会对图形的边缘像素进行半透明的模糊处理 |
| [OH_Drawing_PenGetColor](_drawing.md#ga8a8db886ecf41a729e40a1f760338220)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | uint32_t<br/>函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_PenGetColor](_drawing.md#oh_drawing_pengetcolor) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 |
| [OH_Drawing_PenSetColor](_drawing.md#ga6e5b065f521dd9c41d5e7f2af5c379cb)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;uint32_t&nbsp;color) | void<br/>函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 | | [OH_Drawing_PenSetColor](_drawing.md#oh_drawing_pensetcolor) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, uint32_t color) | 函数用于设置画笔的颜色属性,颜色属性描述了画笔绘制图形轮廓时使用的颜色,用一个32位(ARGB)的变量表示 |
| [OH_Drawing_PenGetWidth](_drawing.md#ga3d898184f61b685d724e6d272fb12168)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | float<br/>函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 | | [OH_Drawing_PenGetWidth](_drawing.md#oh_drawing_pengetwidth) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 |
| [OH_Drawing_PenSetWidth](_drawing.md#ga562b5102bf599e640a94e104480df0f4)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;float&nbsp;width) | void<br/>函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 | | [OH_Drawing_PenSetWidth](_drawing.md#oh_drawing_pensetwidth) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, float width) | 函数用于设置画笔的厚度属性,厚度属性描述了画笔绘制图形轮廓的宽度 |
| [OH_Drawing_PenGetMiterLimit](_drawing.md#ga8f8a512b3930d8883dff59916eaaa72a)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | float<br/>函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 | | [OH_Drawing_PenGetMiterLimit](_drawing.md#oh_drawing_pengetmiterlimit) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 |
| [OH_Drawing_PenSetMiterLimit](_drawing.md#ga73a96e3e9ca95a82f0de2076cb03ffba)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;float&nbsp;miter) | void<br/>函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 | | [OH_Drawing_PenSetMiterLimit](_drawing.md#oh_drawing_pensetmiterlimit) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, float miter) | 函数用于设置折线尖角的限制值,当画笔绘制一条折线,转角类型设置为尖角时,那么此时该属性用于限制出现尖角的长度范围,如果超出则平角显示,不超出依然为尖角 |
| [OH_Drawing_PenGetCap](_drawing.md#ga7db0d5ac28ac24db29fc49c113affc32)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | [OH_Drawing_PenLineCapStyle](_drawing.md#gafa9d815d933e0fd6aa7549d12080fa8f)<br/>函数用于获取画笔笔帽的样式 | | [OH_Drawing_PenGetCap](_drawing.md#oh_drawing_pengetcap) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取画笔笔帽的样式 |
| [OH_Drawing_PenSetCap](_drawing.md#gaa0d8f5e75ec5fbc776c4e5e780e29af3)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;[OH_Drawing_PenLineCapStyle](_drawing.md#gafa9d815d933e0fd6aa7549d12080fa8f)) | void<br/>函数用于设置画笔笔帽样式 | | [OH_Drawing_PenSetCap](_drawing.md#oh_drawing_pensetcap) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, [OH_Drawing_PenLineCapStyle](_drawing.md#oh_drawing_penlinecapstyle)) | 函数用于设置画笔笔帽样式 |
| [OH_Drawing_PenGetJoin](_drawing.md#ga35b26a60ebf70c207f1e8fb8659a9103)&nbsp;(const&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*) | [OH_Drawing_PenLineJoinStyle](_drawing.md#gad10001f23f6c42f97a392cba30011460)<br/>函数用于获取画笔绘制折线转角的样式 | | [OH_Drawing_PenGetJoin](_drawing.md#oh_drawing_pengetjoin) (const [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*) | 函数用于获取画笔绘制折线转角的样式 |
| [OH_Drawing_PenSetJoin](_drawing.md#ga65e9826c39a847b22825e99af65afbb7)&nbsp;([OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)&nbsp;\*,&nbsp;[OH_Drawing_PenLineJoinStyle](_drawing.md#gad10001f23f6c42f97a392cba30011460)) | void<br/>函数用于设置画笔绘制转角的样式 | | [OH_Drawing_PenSetJoin](_drawing.md#oh_drawing_pensetjoin) ([OH_Drawing_Pen](_drawing.md#oh_drawing_pen) \*, [OH_Drawing_PenLineJoinStyle](_drawing.md#oh_drawing_penlinejoinstyle)) | 函数用于设置画笔绘制转角的样式 |
# drawing_text_declaration.h # drawing_text_declaration.h
## **Overview** ## 概述
**Related Modules:** 提供2d drawing文本相关的数据结构声明。
[Drawing](_drawing.md) **自从:**
**Description:** 8
提供2d drawing文本相关的数据结构声明 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Typedefs ### 类型定义
| Typedef&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_FontCollection](_drawing.md#ga4ce31d04a1580d4f50e87b8695fcebc7) | typedef&nbsp;struct&nbsp;[OH_Drawing_FontCollection](_drawing.md#ga4ce31d04a1580d4f50e87b8695fcebc7)<br/>OH_Drawing_FontCollection用于加载字体 | | [OH_Drawing_FontCollection](_drawing.md#oh_drawing_fontcollection) | OH_Drawing_FontCollection用于加载字体 |
| [OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007) | typedef&nbsp;struct&nbsp;[OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007)<br/>OH_Drawing_Typography用于管理排版的布局和显示等 | | [OH_Drawing_Typography](_drawing.md#oh_drawing_typography) | OH_Drawing_Typography用于管理排版的布局和显示等 |
| [OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528) | typedef&nbsp;struct&nbsp;[OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)<br/>OH_Drawing_TextStyle用于管理字体颜色、装饰等 | | [OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) | OH_Drawing_TextStyle用于管理字体颜色、装饰等 |
| [OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9) | typedef&nbsp;struct&nbsp;[OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)<br/>OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等 | | [OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) | OH_Drawing_TypographyStyle用于管理排版风格,如文字方向等 |
| [OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9) | typedef&nbsp;struct&nbsp;[OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)<br/>OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography. | | [OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) | OH_Drawing_TypographyCreate用于创建OH_Drawing_Typography |
# drawing_text_typography.h # drawing_text_typography.h
## **Overview** ## 概述
**Related Modules:** 定义绘制模块中排版相关的函数。
[Drawing](_drawing.md) **自从:**
**Description:** 8
定义绘制模块中排版相关的函数 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Enumerations ### 枚举
| Enumeration&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_TextDirection](_drawing.md#ga7dc9803407c3fea32075122c7605ffb2)&nbsp;{&nbsp;[TEXT_DIRECTION_RTL](_drawing.md#gga7dc9803407c3fea32075122c7605ffb2a7b4debd0a116bc438085a43efa3824cf),&nbsp;[TEXT_DIRECTION_LTR](_drawing.md#gga7dc9803407c3fea32075122c7605ffb2a81d702a35ec4d3482ea5ff10edd8cab7)&nbsp;} | 文字方向 | | [OH_Drawing_TextDirection](_drawing.md#oh_drawing_textdirection) { TEXT_DIRECTION_RTL, TEXT_DIRECTION_LTR } | 文字方向 |
| [OH_Drawing_TextAlign](_drawing.md#ga3fee1a3916c2376e62e7957be15a1b02)&nbsp;{&nbsp;&nbsp;&nbsp;[TEXT_ALIGN_LEFT](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02a3b85bc4d8cfda6b273b534eb2e1cebfc),&nbsp;[TEXT_ALIGN_RIGHT](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02abc81ce8623a972fc7b97f497189c494b),&nbsp;[TEXT_ALIGN_CENTER](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02a4da3c85cde615e7442df8ef17d0753ba),&nbsp;[TEXT_ALIGN_JUSTIFY](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02a3e3185762a0ae703ae1eab769eb3191d),&nbsp;&nbsp;&nbsp;[TEXT_ALIGN_START](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02a72f2441e221a61374bd891dc2b75bcb0),&nbsp;[TEXT_ALIGN_END](_drawing.md#gga3fee1a3916c2376e62e7957be15a1b02a17b99fff762deffd75c0de66cd27d219)&nbsp;} | 文字对齐方式 | | [OH_Drawing_TextAlign](_drawing.md#oh_drawing_textalign) { TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_JUSTIFY, TEXT_ALIGN_START, TEXT_ALIGN_END } | 文字对齐方式 |
| [OH_Drawing_FontWeight](_drawing.md#ga7a1d4dd0ce9dd97bf3bbbad3b87f7f21)&nbsp;{&nbsp;&nbsp;&nbsp;[FONT_WEIGHT_100](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21a23b26a36963095342fe2e0697910a6e6),&nbsp;[FONT_WEIGHT_200](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21a4f29ce93f64a0085ca2154ee25d9e138),&nbsp;[FONT_WEIGHT_300](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21a093d1106fec67eebea0dbcb2ebbe9a64),&nbsp;[FONT_WEIGHT_400](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21a62367da70683540c34ddaf2a519f22a3),&nbsp;&nbsp;&nbsp;[FONT_WEIGHT_500](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21aef238378a2c00c698e269b052d31d904),&nbsp;[FONT_WEIGHT_600](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21a63eebceda71bb1ffdae4a5503d63bbd9),&nbsp;[FONT_WEIGHT_700](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21ae6abaa1dc57d487006cbe6c8e0f87bc6),&nbsp;[FONT_WEIGHT_800](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21ad34b21ce514a03d6d98b75341bb5726e),&nbsp;&nbsp;&nbsp;[FONT_WEIGHT_900](_drawing.md#gga7a1d4dd0ce9dd97bf3bbbad3b87f7f21ac3f4c8f2d6a6922780166cc08df83461)&nbsp;} | 字重 | | [OH_Drawing_FontWeight](_drawing.md#oh_drawing_fontweight) { FONT_WEIGHT_100, FONT_WEIGHT_200, FONT_WEIGHT_300, FONT_WEIGHT_400, FONT_WEIGHT_500, FONT_WEIGHT_600, FONT_WEIGHT_700, FONT_WEIGHT_800, FONT_WEIGHT_900 } | 字重 |
| [OH_Drawing_TextBaseline](_drawing.md#ga23be0106a439e7498cbbb1d048733ec5)&nbsp;{&nbsp;[TEXT_BASELINE_ALPHABETIC](_drawing.md#gga23be0106a439e7498cbbb1d048733ec5ad436b9da96a5246e75e785a0585963f9),&nbsp;[TEXT_BASELINE_IDEOGRAPHIC](_drawing.md#gga23be0106a439e7498cbbb1d048733ec5a723ba0ba56cd7106deb97c95f51febcf)&nbsp;} | 基线位置 | | [OH_Drawing_TextBaseline](_drawing.md#oh_drawing_textbaseline) { TEXT_BASELINE_ALPHABETIC, TEXT_BASELINE_IDEOGRAPHIC } | 基线位置 |
| [OH_Drawing_TextDecoration](_drawing.md#ga11b405dddb93d91c3a5b4482d8a9165b)&nbsp;{&nbsp;[TEXT_DECORATION_NONE](_drawing.md#gga11b405dddb93d91c3a5b4482d8a9165ba2b42614c2c9b73ffecf31769cfd60f28)&nbsp;=&nbsp;0x0,&nbsp;[TEXT_DECORATION_UNDERLINE](_drawing.md#gga11b405dddb93d91c3a5b4482d8a9165ba0fc17108b6c8a91d840889336c669dda)&nbsp;=&nbsp;0x1,&nbsp;[TEXT_DECORATION_OVERLINE](_drawing.md#gga11b405dddb93d91c3a5b4482d8a9165bad8415c121f9b656cd5c6cab927d78802)&nbsp;=&nbsp;0x2,&nbsp;[TEXT_DECORATION_LINE_THROUGH](_drawing.md#gga11b405dddb93d91c3a5b4482d8a9165ba25692d42e0a907af878d99a0a31f7f47)&nbsp;=&nbsp;0x4&nbsp;} | 文本装饰 | | [OH_Drawing_TextDecoration](_drawing.md#oh_drawing_textdecoration) { TEXT_DECORATION_NONE = 0x0, TEXT_DECORATION_UNDERLINE = 0x1, TEXT_DECORATION_OVERLINE = 0x2, TEXT_DECORATION_LINE_THROUGH = 0x4 } | 文本装饰 |
| [OH_Drawing_FontStyle](_drawing.md#ga9cd0177d2561ccef51adbae0f8a42eec)&nbsp;{&nbsp;[FONT_STYLE_NORMAL](_drawing.md#gga9cd0177d2561ccef51adbae0f8a42eeca307e676fb5de5c785e856272b2f0e8ce),&nbsp;[FONT_STYLE_ITALIC](_drawing.md#gga9cd0177d2561ccef51adbae0f8a42eeca6054e24016c46486668dd42e4b86c036)&nbsp;} | 区分字体是否为斜体 | | [OH_Drawing_FontStyle](_drawing.md#oh_drawing_fontstyle) { FONT_STYLE_NORMAL, FONT_STYLE_ITALIC } | 区分字体是否为斜体 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_CreateTypographyStyle](_drawing.md#ga19561093a2d5ec17f2c73b40f0d97376)&nbsp;(void) | [OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*<br/>创建OH_Drawing_TypographyStyle | | [OH_Drawing_CreateTypographyStyle](_drawing.md#oh_drawing_createtypographystyle) (void) | 创建OH_Drawing_TypographyStyle |
| [OH_Drawing_DestroyTypographyStyle](_drawing.md#ga9bd838c0d86136e16faca0ada643d87e)&nbsp;([OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*) | void<br/>释放被OH_Drawing_TypographyStyle对象占据的内存 | | [OH_Drawing_DestroyTypographyStyle](_drawing.md#oh_drawing_destroytypographystyle) ([OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) \*) | 释放被OH_Drawing_TypographyStyle对象占据的内存 |
| [OH_Drawing_SetTypographyTextDirection](_drawing.md#ga9e96b89ffc3f06f50ab38f05689e766e)&nbsp;([OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*,&nbsp;int) | void<br/>设置文本方向 | | [OH_Drawing_SetTypographyTextDirection](_drawing.md#oh_drawing_settypographytextdirection) ([OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) \*, int) | 设置文本方向 |
| [OH_Drawing_SetTypographyTextAlign](_drawing.md#gaa1a8b20a882ae6aa4e2ad442a18423da)&nbsp;([OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*,&nbsp;int) | void<br/>设置文本对齐方式 | | [OH_Drawing_SetTypographyTextAlign](_drawing.md#oh_drawing_settypographytextalign) ([OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) \*, int) | 设置文本对齐方式 |
| [OH_Drawing_SetTypographyTextMaxLines](_drawing.md#gab74fd8ef23005bf584f87357147fa379)&nbsp;([OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*,&nbsp;int) | void<br/>设置文本最大行数 | | [OH_Drawing_SetTypographyTextMaxLines](_drawing.md#oh_drawing_settypographytextmaxlines) ([OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) \*, int) | 设置文本最大行数 |
| [OH_Drawing_CreateTextStyle](_drawing.md#ga9041c35231647ed34306ef26f21037f9)&nbsp;(void) | [OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*<br/>创建OH_Drawing_TextStyle | | [OH_Drawing_CreateTextStyle](_drawing.md#oh_drawing_createtextstyle) (void) | 创建OH_Drawing_TextStyle |
| [OH_Drawing_DestroyTextStyle](_drawing.md#ga2550946ac8d3c8c9ddc548e128175020)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*) | void<br/>释放被OH_Drawing_TextStyle对象占据的内存 | | [OH_Drawing_DestroyTextStyle](_drawing.md#oh_drawing_destroytextstyle) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*) | 释放被OH_Drawing_TextStyle对象占据的内存 |
| [OH_Drawing_SetTextStyleColor](_drawing.md#ga4c03826dd970defade08b67ed1861fc8)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;uint32_t) | void<br/>设置文本颜色 | | [OH_Drawing_SetTextStyleColor](_drawing.md#oh_drawing_settextstylecolor) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, uint32_t) | 设置文本颜色 |
| [OH_Drawing_SetTextStyleFontSize](_drawing.md#ga4f435be1d8b20bd0abac441ac91bb81d)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;double) | void<br/>设置字号 | | [OH_Drawing_SetTextStyleFontSize](_drawing.md#oh_drawing_settextstylefontsize) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, double) | 设置字号 |
| [OH_Drawing_SetTextStyleFontWeight](_drawing.md#ga751dd287f984367c18de6ca3a3a304ec)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;int) | void<br/>设置字重 | | [OH_Drawing_SetTextStyleFontWeight](_drawing.md#oh_drawing_settextstylefontweight) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, int) | 设置字重 |
| [OH_Drawing_SetTextStyleBaseLine](_drawing.md#gacb93fa7c791e719cf9c5d218981f61ee)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;int) | void<br/>设置字体基线位置 | | [OH_Drawing_SetTextStyleBaseLine](_drawing.md#oh_drawing_settextstylebaseline) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, int) | 设置字体基线位置 |
| [OH_Drawing_SetTextStyleDecoration](_drawing.md#ga2f029e23749fcd121aaae6e233202ded)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;int) | void<br/>设置装饰 | | [OH_Drawing_SetTextStyleDecoration](_drawing.md#oh_drawing_settextstyledecoration) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, int) | 设置装饰 |
| [OH_Drawing_SetTextStyleDecorationColor](_drawing.md#ga22304942171ce4548b50057bd7d606be)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;uint32_t) | void<br/>设置装饰颜色 | | [OH_Drawing_SetTextStyleDecorationColor](_drawing.md#oh_drawing_settextstyledecorationcolor) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, uint32_t) | 设置装饰颜色 |
| [OH_Drawing_SetTextStyleFontHeight](_drawing.md#gab96b5567c05f34e6ba7d48a4dd75eab4)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;double) | void<br/>设置字体高度 | | [OH_Drawing_SetTextStyleFontHeight](_drawing.md#oh_drawing_settextstylefontheight) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, double) | 设置字体高度 |
| [OH_Drawing_SetTextStyleFontFamilies](_drawing.md#ga3f46d90176575f24040828264ce18a90)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;int,&nbsp;const&nbsp;char&nbsp;\*fontFamilies[]) | void<br/>设置字体类型 | | [OH_Drawing_SetTextStyleFontFamilies](_drawing.md#oh_drawing_settextstylefontfamilies) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, int, const char \*fontFamilies[]) | 设置字体类型 |
| [OH_Drawing_SetTextStyleFontStyle](_drawing.md#ga67afa0910007fa3d8b15f2b6df61712c)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;int) | void<br/>设置字体风格 | | [OH_Drawing_SetTextStyleFontStyle](_drawing.md#oh_drawing_settextstylefontstyle) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, int) | 设置字体风格 |
| [OH_Drawing_SetTextStyleLocale](_drawing.md#ga7eb6f2da34059c013cfb0567c44813d4)&nbsp;([OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*,&nbsp;const&nbsp;char&nbsp;\*) | void<br/>设置语言区域 | | [OH_Drawing_SetTextStyleLocale](_drawing.md#oh_drawing_settextstylelocale) ([OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*, const char \*) | 设置语言区域 |
| [OH_Drawing_CreateTypographyHandler](_drawing.md#gae72088abf73419c0c8e8e524602a317e)&nbsp;([OH_Drawing_TypographyStyle](_drawing.md#ga270cc54313a929ea90235840668daef9)&nbsp;\*,&nbsp;[OH_Drawing_FontCollection](_drawing.md#ga4ce31d04a1580d4f50e87b8695fcebc7)&nbsp;\*) | [OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*<br/>创建指向OH_Drawing_TypographyCreate对象的指针 | | [OH_Drawing_CreateTypographyHandler](_drawing.md#oh_drawing_createtypographyhandler) ([OH_Drawing_TypographyStyle](_drawing.md#oh_drawing_typographystyle) \*, [OH_Drawing_FontCollection](_drawing.md#oh_drawing_fontcollection) \*) | 创建指向OH_Drawing_TypographyCreate对象的指针 |
| [OH_Drawing_DestroyTypographyHandler](_drawing.md#ga211dced7f1eaed0c5bd507cd75d003c8)&nbsp;([OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*) | void<br/>释放被OH_Drawing_TypographyCreate对象占据的内存 | | [OH_Drawing_DestroyTypographyHandler](_drawing.md#oh_drawing_destroytypographyhandler) ([OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) \*) | 释放被OH_Drawing_TypographyCreate对象占据的内存 |
| [OH_Drawing_TypographyHandlerPushStyle](_drawing.md#ga5aff793cec1b58c171817649b01f35d1)&nbsp;([OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*,&nbsp;[OH_Drawing_TextStyle](_drawing.md#gad731266accf168a6b50e1fa33ce90528)&nbsp;\*) | void<br/>设置排版风格 | | [OH_Drawing_TypographyHandlerPushTextStyle](_drawing.md#oh_drawing_typographyhandlerpushtextstyle) ([OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) \*, [OH_Drawing_TextStyle](_drawing.md#oh_drawing_textstyle) \*) | 设置排版风格 |
| [OH_Drawing_TypographyHandlerAddText](_drawing.md#ga0bb4f9730faa77f6ed8cdce25e7965f2)&nbsp;([OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*,&nbsp;const&nbsp;char&nbsp;\*) | void<br/>设置文本内容 | | [OH_Drawing_TypographyHandlerAddText](_drawing.md#oh_drawing_typographyhandleraddtext) ([OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) \*, const char \*) | 设置文本内容 |
| [OH_Drawing_TypographyHandlerPop](_drawing.md#gabe9b81431e1a7ca473fc0659c150bb6b)&nbsp;([OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*) | void<br/>排版弹出 | | [OH_Drawing_TypographyHandlerPopTextStyle](_drawing.md#oh_drawing_typographyhandlerpoptextstyle) ([OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) \*) | 排版弹出 |
| [OH_Drawing_CreateTypography](_drawing.md#gaf996ac9db09b8d7c21b8ea4797ea0c19)&nbsp;([OH_Drawing_TypographyCreate](_drawing.md#gaedefc2b3d226b0b07abcbce76be4cdb9)&nbsp;\*) | [OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007)&nbsp;\*<br/>创建OH_Drawing_Typography | | [OH_Drawing_CreateTypography](_drawing.md#oh_drawing_createtypography) ([OH_Drawing_TypographyCreate](_drawing.md#oh_drawing_typographycreate) \*) | 创建OH_Drawing_Typography |
| [OH_Drawing_DestroyTypography](_drawing.md#ga2d0d1b715931c104042c75e4d21a86a3)&nbsp;([OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007)&nbsp;\*) | void<br/>释放OH_Drawing_Typography对象占据的内存 | | [OH_Drawing_DestroyTypography](_drawing.md#oh_drawing_destroytypography) ([OH_Drawing_Typography](_drawing.md#oh_drawing_typography) \*) | 释放OH_Drawing_Typography对象占据的内存 |
| [OH_Drawing_TypographyLayout](_drawing.md#ga9032552c1d8d8e258f86832190223843)&nbsp;([OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007)&nbsp;\*,&nbsp;double) | void<br/>排版布局 | | [OH_Drawing_TypographyLayout](_drawing.md#oh_drawing_typographylayout) ([OH_Drawing_Typography](_drawing.md#oh_drawing_typography) \*, double) | 排版布局 |
| [OH_Drawing_TypographyPaint](_drawing.md#ga8b12b7dc251b3a2bb71f7e289a27e174)&nbsp;([OH_Drawing_Typography](_drawing.md#ga70d06422fc84eb1ba49e35f525573007)&nbsp;\*,&nbsp;[OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)&nbsp;\*,&nbsp;double,&nbsp;double) | void<br/>显示文本 | | [OH_Drawing_TypographyPaint](_drawing.md#oh_drawing_typographypaint) ([OH_Drawing_Typography](_drawing.md#oh_drawing_typography) \*, [OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*, double, double) | 显示文本 |
# drawing_types.h # drawing_types.h
## **Overview** ## 概述
**Related Modules:** 文件中定义了用于绘制2d图形的数据类型,包括画布、画笔、画刷、位图和路径。
[Drawing](_drawing.md) **自从:**
**Description:** 8
文件中定义了用于绘制2d图形的数据类型,包括画布、画笔、画刷、位图和路径 **相关模块:**
[Drawing](_drawing.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Typedefs ### 类型定义
| Typedef&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a) | typedef&nbsp;struct&nbsp;[OH_Drawing_Canvas](_drawing.md#ga086e2de47ef7bfe6c96e6b09e87da33a)<br/>OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字 | | [OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) | OH_Drawing_Canvas定义为一块矩形的画布,可以结合画笔和画刷在上面绘制各种形状、图片和文字 |
| [OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2) | typedef&nbsp;struct&nbsp;[OH_Drawing_Pen](_drawing.md#ga88e73d9d7b62e6113237fc0f828910d2)<br/>OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色 | | [OH_Drawing_Pen](_drawing.md#oh_drawing_pen) | OH_Drawing_Pen定义为画笔,画笔用于描述绘制图形轮廓的样式和颜色 |
| [OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711) | typedef&nbsp;struct&nbsp;[OH_Drawing_Brush](_drawing.md#ga178c83de4a084d35c30e4681319ea711)<br/>OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色 | | [OH_Drawing_Brush](_drawing.md#oh_drawing_brush) | OH_Drawing_Brush定义为画刷,画刷用于描述填充图形的样式和颜色 |
| [OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023) | typedef&nbsp;struct&nbsp;[OH_Drawing_Path](_drawing.md#gab7e53fc0181099b4a0a3e4a08d3c9023)<br/>OH_Drawing_Path定义为路径,路径用于自定义各种形状 | | [OH_Drawing_Path](_drawing.md#oh_drawing_path) | OH_Drawing_Path定义为路径,路径用于自定义各种形状 |
| [OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb) | typedef&nbsp;struct&nbsp;[OH_Drawing_Bitmap](_drawing.md#ga8ac4e64cd1e2c651d11325e04c72ddeb)<br/>OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据 | | [OH_Drawing_Bitmap](_drawing.md#oh_drawing_bitmap) | OH_Drawing_Bitmap定义为位图,位图是一块内存,内存中包含了描述一张图片的像素数据 |
### Enumerations ### 枚举
| Enumeration&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_Drawing_ColorFormat](_drawing.md#ga6a37fff6c3e0b0d9d81b01755ef846db)&nbsp;{&nbsp;&nbsp;&nbsp;[COLOR_FORMAT_UNKNOWN](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dbab58141bf00d632ba06094d3c4b6446c2),&nbsp;[COLOR_FORMAT_ALPHA_8](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dbabe54d848a7de45ac9a9a89a6eb6a1886),&nbsp;[COLOR_FORMAT_RGB_565](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dbabc7b2f524d90d876ad222dd595c287d9),&nbsp;[COLOR_FORMAT_ARGB_4444](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dba3dac16f10989bdacb479e7fcd9b8861e),&nbsp;&nbsp;&nbsp;[COLOR_FORMAT_RGBA_8888](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dba3b1984f6b8b6fe5f5d65215c95e80ac2),&nbsp;[COLOR_FORMAT_BGRA_8888](_drawing.md#gga6a37fff6c3e0b0d9d81b01755ef846dba44017098e353684bc3bbd2cd0878df15)&nbsp;} | OH_Drawing_ColorFormat用于描述位图像素的存储格式 | | [OH_Drawing_ColorFormat](_drawing.md#oh_drawing_colorformat) { COLOR_FORMAT_UNKNOWN, COLOR_FORMAT_ALPHA_8, COLOR_FORMAT_RGB_565, COLOR_FORMAT_ARGB_4444, COLOR_FORMAT_RGBA_8888, COLOR_FORMAT_BGRA_8888 } | OH_Drawing_ColorFormat用于描述位图像素的存储格式 |
| [OH_Drawing_AlphaFormat](_drawing.md#gac4dc831be312bb0a7a4745448f4407d3)&nbsp;{&nbsp;[ALPHA_FORMAT_UNKNOWN](_drawing.md#ggac4dc831be312bb0a7a4745448f4407d3ac7e2536628ce62acfc14ec2538425a4a),&nbsp;[ALPHA_FORMAT_OPAQUE](_drawing.md#ggac4dc831be312bb0a7a4745448f4407d3abd3d60c5f30c90748393276a5845f662),&nbsp;[ALPHA_FORMAT_PREMUL](_drawing.md#ggac4dc831be312bb0a7a4745448f4407d3ac0ad416cd779ddc62466d6dceb9a757f),&nbsp;[ALPHA_FORMAT_UNPREMUL](_drawing.md#ggac4dc831be312bb0a7a4745448f4407d3a0b8120300ddca06e3d5db79bfad59a32)&nbsp;} | OH_Drawing_AlphaFormat用于描述位图像素的透明度分量 | | [OH_Drawing_AlphaFormat](_drawing.md#oh_drawing_alphaformat) { ALPHA_FORMAT_UNKNOWN, ALPHA_FORMAT_OPAQUE, ALPHA_FORMAT_PREMUL, ALPHA_FORMAT_UNPREMUL } | OH_Drawing_AlphaFormat用于描述位图像素的透明度分量 |
# external_window.h # external_window.h
## **Overview** ## 概述
**Related Modules:** 定义获取和使用NativeWindow的相关函数。
[NativeWindow](_native_window.md) **自从:**
**Description:** 8
定义获取和使用NativeWindow的相关函数 **相关模块:**
[NativeWindow](_native_window.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeWindow_CreateNativeWindowFromSurface](_native_window.md#ga4225dd025093bc610670c2b517f186c2)&nbsp;(void&nbsp;\*pSurface) | struct&nbsp;NativeWindow&nbsp;\*<br/>创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 | | [OH_NativeWindow_CreateNativeWindowFromSurface](_native_window.md#oh_nativewindow_createnativewindowfromsurface) (void \*pSurface) | 创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 |
| [OH_NativeWindow_DestroyNativeWindow](_native_window.md#ga1ca5f2e39a03b6546352ac90be19238d)&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window) | void<br/>将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindow](_native_window.md#oh_nativewindow_destroynativewindow) (struct NativeWindow \*window) | 将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 |
| [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#gaec1b04ace16a364d79b7d54cf917e6f5)&nbsp;(void&nbsp;\*pSurfaceBuffer) | struct&nbsp;NativeWindowBuffer&nbsp;\*<br/>创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 | | [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | 创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 |
| [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#gafa11a7f9a36b2e6962cc34790eb1e87e)&nbsp;(struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | void<br/>将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#oh_nativewindow_destroynativewindowbuffer) (struct NativeWindowBuffer \*buffer) | 将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 |
| [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#ga80cad8d3c2863294f828caa4d3422c2c)&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*\*buffer,&nbsp;int&nbsp;\*fenceFd) | int32_t<br/>通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 | | [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#oh_nativewindow_nativewindowrequestbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*\*buffer, int \*fenceFd) | 通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 |
| [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#ga8489a6525b5c9f7a6b52aafba07fb777)&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*buffer,&nbsp;int&nbsp;fenceFd,&nbsp;Region&nbsp;region) | int32_t<br/>通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 | | [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#oh_nativewindow_nativewindowflushbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*buffer, int fenceFd, Region region) | 通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 |
| [OH_NativeWindow_NativeWindowCancelBuffer](_native_window.md#gad7b6ffa8b402f5be0bf6e742b18f03d0)&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | int32_t<br/>通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 | | [OH_NativeWindow_NativeWindowCancelBuffer](_native_window.md#oh_nativewindow_nativewindowcancelbuffer) (struct NativeWindow \*window, struct NativeWindowBuffer \*buffer) | 通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 |
| [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#ga5620fba277d2f086da6c6d7434c09253)&nbsp;(struct&nbsp;NativeWindow&nbsp;\*window,&nbsp;int&nbsp;code,...) | int32_t<br/>设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 | | [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#oh_nativewindow_nativewindowhandleopt) (struct NativeWindow \*window, int code,...) | 设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 |
| [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#ga28c34ab9b0751010cb716ca9acd6dfef)&nbsp;(struct&nbsp;NativeWindowBuffer&nbsp;\*buffer) | BufferHandle&nbsp;\*<br/>通过NativeWindowBuffer获取该buffer的BufferHandle指针 | | [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#oh_nativewindow_getbufferhandlefromnative) (struct NativeWindowBuffer \*buffer) | 通过NativeWindowBuffer获取该buffer的BufferHandle指针 |
| [OH_NativeWindow_NativeObjectReference](_native_window.md#gafcbd7894c5cdae431e591028c5f7f709)&nbsp;(void&nbsp;\*obj) | int32_t<br/>增加一个NativeObject的引用计数 | | [OH_NativeWindow_NativeObjectReference](_native_window.md#oh_nativewindow_nativeobjectreference) (void \*obj) | 增加一个NativeObject的引用计数 |
| [OH_NativeWindow_NativeObjectUnreference](_native_window.md#ga24567fa7daee679bf927623adac93a9f)&nbsp;(void&nbsp;\*obj) | int32_t<br/>减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 | | [OH_NativeWindow_NativeObjectUnreference](_native_window.md#oh_nativewindow_nativeobjectunreference) (void \*obj) | 减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 |
| [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#ga93828d364eebf3ec5c81d7897757f9f2)&nbsp;(void&nbsp;\*obj) | int32_t<br/>获取NativeObject的MagicId | | [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#oh_nativewindow_getnativeobjectmagic) (void \*obj) | 获取NativeObject的MagicId |
# Image
提供获取pixelmap的数据和信息的接口方法。
@Syscap SystemCapability.Multimedia.Image
**自从:**
8
## 汇总
### 文件
| 文件名称 | 描述 |
| -------- | -------- |
| [image_pixel_map_napi.h](image__pixel__map__napi_8h.md) | 声明可以锁定并访问pixelmap数据的方法,声明解锁的方法。 |
### 结构体
| 结构体名称 | 描述 |
| -------- | -------- |
| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | 用于定义 pixel map 的相关信息。 |
### 枚举
| 枚举名称 | 描述 |
| -------- | -------- |
| { OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, <br/>OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, <br/>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, <br/>OHOS_IMAGE_RESULT_SUCCESS = 0, <br/>OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | 函数方法返回值的错误码的[枚举](#anonymous-enum)。 |
| { OHOS_PIXEL_MAP_FORMAT_NONE = 0, <br/>OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3, <br/>OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 } | pixel 格式的[枚举](#anonymous-enum-1)。 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_GetImageInfo](#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_ohos_pixel_map_info.md) \*info) | 获取 **PixelMap** 的信息,并记录信息到[OhosPixelMapInfo](_ohos_pixel_map_info.md)结构中。 |
| [OH_AccessPixels](#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | 获取**PixelMap**对象数据的内存地址,并锁定该内存。 |
| [OH_UnAccessPixels](#oh_unaccesspixels) (napi_env env, napi_value value) | 释放**PixelMap**对象数据的内存锁, 用于匹配方法[OH_AccessPixels](#oh_accesspixels)。 |
## 详细描述
## 枚举类型说明
### anonymous enum
```
anonymous enum
```
**描述:**
函数方法返回值的错误码的枚举。
| 枚举值 | 描述 |
| -------- | -------- |
| OH_NATIVEXCOMPONENT_RESULT_SUCCESS | 成功结果。 |
| OH_NATIVEXCOMPONENT_RESULT_FAILED | 失败结果。 |
| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | 无效参数。 |
| OHOS_IMAGE_RESULT_SUCCESS | 成功的结果。 |
| OHOS_IMAGE_RESULT_BAD_PARAMETER | 无效值。 |
**自从:**
8
### anonymous enum
```
anonymous enum
```
**描述:**
pixel 格式的枚举。
| 枚举值 | 描述 |
| -------- | -------- |
| OHOS_PIXEL_MAP_FORMAT_NONE | 未知的格式。 |
| OHOS_PIXEL_MAP_FORMAT_RGBA_8888 | 32-bit RGBA。由 R, G, B组成,包括 A 都需要占用 8 bits。存储顺序是从高位到低位。 |
| OHOS_PIXEL_MAP_FORMAT_RGB_565 | 16-bit RGB。仅由 R, G, B 组成。存储顺序是从高位到低位: 红色占用5 bits,绿色占用6 bits,蓝色占用5 bits。 |
**自从:**
8
## 函数说明
### OH_AccessPixels()
```
int32_t OH_AccessPixels (napi_env env, napi_value value, void ** addrPtr )
```
**描述:**
获取**PixelMap**对象数据的内存地址,并锁定该内存。
函数执行成功后,**\*addrPtr**就是获取的待访问的内存地址。访问操作完成后,必须要使用[OH_UnAccessPixels](#oh_unaccesspixels)来释放锁, 否则的话资源无法被释放。待解锁后,内存地址就不可以再被访问和操作。
**参数:**
| Name | 描述 |
| -------- | -------- |
| env | napi的环境指针。 |
| value | 应用层的 **PixelMap** 对象。 |
| addrPtr | 用于指向的内存地址的双指针对象。 |
**参见:**
[OH_UnAccessPixels](#oh_unaccesspixels)
**返回:**
操作成功则返回OHOS_IMAGE_RESULT_SUCCESS; 如果操作失败,则返回错误码。
**自从:**
8
### OH_GetImageInfo()
```
int32_t OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo * info )
```
**描述:**
获取 **PixelMap** 的信息,并记录信息到[OhosPixelMapInfo](_ohos_pixel_map_info.md)结构中。
**参数:**
| Name | 描述 |
| -------- | -------- |
| env | napi的环境指针。 |
| value | 应用层的 **PixelMap** 对象。 |
| info | 用于保存信息的指针对象。更多细节, 参看 [OhosPixelMapInfo](_ohos_pixel_map_info.md)。 |
**返回:**
如果获取并保存信息成功,则返回**0**; 如果操作失败,则返回错误码。
**参见:**
[OhosPixelMapInfo](_ohos_pixel_map_info.md)
**自从:**
8
### OH_UnAccessPixels()
```
int32_t OH_UnAccessPixels (napi_env env, napi_value value )
```
**描述:**
释放**PixelMap**对象数据的内存锁, 用于匹配方法[OH_AccessPixels](#oh_accesspixels)
**参数:**
| Name | 描述 |
| -------- | -------- |
| env | napi的环境指针。 |
| value | 应用层的 **PixelMap** 对象。 |
**返回:**
操作成功则返回OHOS_IMAGE_RESULT_SUCCESS; 如果操作失败,则返回错误码。
**参见:**
AccessPixels
**自从:**
8
# image_pixel_map_napi.h
## 概述
声明可以锁定并访问pixelmap数据的方法,声明解锁的方法。
**自从:**
8
**相关模块:**
[Image](image.md)
## 汇总
### 结构体
| 结构体名称 | 描述 |
| -------- | -------- |
| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | 用于定义 pixel map 的相关信息。 |
### 枚举
| 枚举名称 | 描述 |
| -------- | -------- |
| { OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, <br/>OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, <br/>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, <br/>OHOS_IMAGE_RESULT_SUCCESS = 0, <br/>OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | 函数方法返回值的错误码的[枚举](image.md#anonymous-enum)。 |
| { OHOS_PIXEL_MAP_FORMAT_NONE = 0, <br/>OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3, <br/>OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 } | pixel 格式的[枚举](image.md#anonymous-enum-1)。 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_GetImageInfo](image.md#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_ohos_pixel_map_info.md) \*info) | 获取 **PixelMap** 的信息,并记录信息到[OhosPixelMapInfo](_ohos_pixel_map_info.md)结构中。 |
| [OH_AccessPixels](image.md#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | 获取**PixelMap**对象数据的内存地址,并锁定该内存。 |
| [OH_UnAccessPixels](image.md#oh_unaccesspixels) (napi_env env, napi_value value) | 释放**PixelMap**对象数据的内存锁, 用于匹配方法[OH_AccessPixels](image.md#oh_accesspixels)。 |
# log.h # log.h
## **Overview** ## 概述
**Related Modules:** HiLog模块日志接口定义,通过这些接口实现日志打印相关功能。
[HiLog](_hi_log.md) 用户输出日志时,先定义日志所属业务领域、日志TAG,然后按照类型、级别选择对应API,指定参数隐私标识输出日志内容。
**Description:** 业务领域:指定日志所对应的业务领域,用户自定义使用,用于标识业务的子系统、模块。16进制整数,范围0x0~0xFFFF。
HiLog模块日志接口定义,通过这些接口实现日志打印相关功能。 日志TAG:字符串常量,用于标识调用所在的类或者业务。
日志级别:DEBUG、INFO、WARN、ERROR、FATAL。
参数格式:类printf的方式,包括格式字符串(包括参数类型标识)和变参。
隐私参数标识:在格式字符串每个参数中符号后类型前增加{public}、{private}标识。
注意:每个参数未指定隐私标识时,缺省为隐私。
使用示例:
定义业务领域、TAG:
```
#define LOG_DOMAIN 0x0201
#define LOG_TAG "MY_TAG"
```
用户输出日志时,先定义日志所属业务领域、日志TAG,然后按照类型、级别选择对应API,指定参数隐私标识输出日志内容。 业务领域:指定日志所对应的业务领域,用户自定义使用,用于标识业务的子系统、模块。16进制整数,范围0x0~0xFFFF。 日志TAG:字符串常量,用于标识调用所在的类或者业务。 日志级别:DEBUG、INFO、WARN、ERROR、FATAL。 参数格式:类printf的方式,包括格式字符串(包括参数类型标识)和变参。 隐私参数标识:在格式字符串每个参数中符号后类型前增加{public}、{private}标识。注意:每个参数未指定隐私标识时,缺省为隐私。 使用示例: 定义业务领域、TAG: \#define LOG_DOMAIN 0x0201 \#define LOG_TAG "MY_TAG" 日志打印: HILOG_WARN([LOG_APP](_hi_log.md#ggaf67907baa897e9fb84df0cb89795b87ca84f0546432a39b6f5e8a777d5cf667b5), "Failed to visit %{private}s, reason:%{public}d.", url, errno); 结果输出: 05-06 15:01:06.870 1051 1051 W 0201/MY_TAG: Failed to visit &lt;private&gt;, reason:503. 日志打印:
```
HILOG_WARN(LOG_APP, "Failed to visit %{private}s, reason:%{public}d.", url, errno);
```
结果输出:
```
05-06 15:01:06.870 1051 1051 W 0201/MY_TAG: Failed to visit <private>, reason:503.
```
**自从:**
**Since:**
8 8
## **Summary** **相关模块:**
[HiLog](_hi_log.md)
## 汇总
### Macros ### 宏定义
| Macro&nbsp;Name&nbsp;and&nbsp;Value | Description | | 宏定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d)&nbsp;&nbsp;&nbsp;0 | 日志所对应的业务领域,用于标识业务的子系统、模块。 | | [LOG_DOMAIN](_hi_log.md#log_domain) 0 | 日志所对应的业务领域,用于标识业务的子系统、模块。 |
| [LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6)&nbsp;&nbsp;&nbsp;NULL | 字符串常量,标识调用所在的类或者业务。 | | [LOG_TAG](_hi_log.md#log_tag) NULL | 字符串常量,标识调用所在的类或者业务。 |
| [OH_LOG_DEBUG](_hi_log.md#gac9b9319de06bce0df57ef440ccaa25fc)(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)[OH_LOG_Print](_hi_log.md#gaed4b343058326b7f5dbcac6799025946)((type),&nbsp;[LOG_DEBUG](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ab9f002c6ffbfd511da8090213227454e),&nbsp;[LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d),&nbsp;[LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6),&nbsp;__VA_ARGS__)) | DEBUG级别写日志,宏封装接口。 | | [OH_LOG_DEBUG](_hi_log.md#oh_log_debug)(type, ...) ((void)[OH_LOG_Print](_hi_log.md#oh_log_print)((type), LOG_DEBUG, LOG_DOMAIN, LOG_TAG, \_\_VA\_ARGS\_\_)) | DEBUG级别写日志,宏封装接口。 |
| [OH_LOG_INFO](_hi_log.md#gadf3fd661bccb575348c5109a0f24f252)(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)[OH_LOG_Print](_hi_log.md#gaed4b343058326b7f5dbcac6799025946)((type),&nbsp;[LOG_INFO](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9a6e98ff471e3ce6c4ef2d75c37ee51837),&nbsp;[LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d),&nbsp;[LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6),&nbsp;__VA_ARGS__)) | INFO级别写日志,宏封装接口。 | | [OH_LOG_INFO](_hi_log.md#oh_log_info)(type, ...) ((void)[OH_LOG_Print](_hi_log.md#oh_log_print)((type), LOG_INFO, LOG_DOMAIN, LOG_TAG, \_\_VA\_ARGS\_\_)) | INFO级别写日志,宏封装接口。 |
| [OH_LOG_WARN](_hi_log.md#ga1beaeee414c2e0238db4c57212809737)(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)[OH_LOG_Print](_hi_log.md#gaed4b343058326b7f5dbcac6799025946)((type),&nbsp;[LOG_WARN](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ac8041ffa22bc823d4726701cdb13fc13),&nbsp;[LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d),&nbsp;[LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6),&nbsp;__VA_ARGS__)) | WARN级别写日志,宏封装接口。 | | [OH_LOG_WARN](_hi_log.md#oh_log_warn)(type, ...) ((void)[OH_LOG_Print](_hi_log.md#oh_log_print)((type), LOG_WARN, LOG_DOMAIN, LOG_TAG, \_\_VA\_ARGS\_\_)) | WARN级别写日志,宏封装接口。 |
| [OH_LOG_ERROR](_hi_log.md#gab7e62682d195ee81093e7e08673c4941)(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)[OH_LOG_Print](_hi_log.md#gaed4b343058326b7f5dbcac6799025946)((type),&nbsp;[LOG_ERROR](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473),&nbsp;[LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d),&nbsp;[LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6),&nbsp;__VA_ARGS__)) | ERROR级别写日志,宏封装接口。 | | [OH_LOG_ERROR](_hi_log.md#oh_log_error)(type, ...) ((void)[OH_LOG_Print](_hi_log.md#oh_log_print)((type), LOG_ERROR, LOG_DOMAIN, LOG_TAG, \_\_VA\_ARGS\_\_)) | ERROR级别写日志,宏封装接口。 |
| [OH_LOG_FATAL](_hi_log.md#ga17370605a946403e37024ea898d27f55)(type,&nbsp;...)&nbsp;&nbsp;&nbsp;((void)HiLogPrint((type),&nbsp;[LOG_FATAL](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ac630750884d91cb9767ef2200bbb048b),&nbsp;[LOG_DOMAIN](_hi_log.md#ga95a1d08c807e0aada863b5298a61d08d),&nbsp;[LOG_TAG](_hi_log.md#ga7ce0df38eb467e59f209470c8f5ac4e6),&nbsp;__VA_ARGS__)) | FATAL级别写日志,宏封装接口。 | | [OH_LOG_FATAL](_hi_log.md#oh_log_fatal)(type, ...) ((void)HiLogPrint((type), LOG_FATAL, LOG_DOMAIN, LOG_TAG, \_\_VA\_ARGS\_\_s)) | FATAL级别写日志,宏封装接口。 |
### Enumerations ### 枚举
| Enumeration&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [LogType](_hi_log.md#gaf67907baa897e9fb84df0cb89795b87c)&nbsp;{&nbsp;[LOG_APP](_hi_log.md#ggaf67907baa897e9fb84df0cb89795b87ca84f0546432a39b6f5e8a777d5cf667b5)&nbsp;=&nbsp;0&nbsp;} | 日志类型。 | | [LogType](_hi_log.md#logtype) { LOG_APP= 0 } | 日志类型。 |
| [LogLevel](_hi_log.md#gaca1fd1d8935433e6ba2e3918214e07f9)&nbsp;{&nbsp;&nbsp;&nbsp;[LOG_DEBUG](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ab9f002c6ffbfd511da8090213227454e)&nbsp;=&nbsp;3,&nbsp;[LOG_INFO](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9a6e98ff471e3ce6c4ef2d75c37ee51837)&nbsp;=&nbsp;4,&nbsp;[LOG_WARN](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ac8041ffa22bc823d4726701cdb13fc13)&nbsp;=&nbsp;5,&nbsp;[LOG_ERROR](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473)&nbsp;=&nbsp;6,&nbsp;&nbsp;&nbsp;[LOG_FATAL](_hi_log.md#ggaca1fd1d8935433e6ba2e3918214e07f9ac630750884d91cb9767ef2200bbb048b)&nbsp;=&nbsp;7&nbsp;} | 日志级别。 | | [LogLevel](_hi_log.md#loglevel) { LOG_DEBUG = 3, LOG_INFO = 4, LOG_WARN = 5, LOG_ERROR = 6, LOG_FATAL =7 } | 日志级别。 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_LOG_Print](_hi_log.md#gaed4b343058326b7f5dbcac6799025946)&nbsp;([LogType](_hi_log.md#gaf67907baa897e9fb84df0cb89795b87c)&nbsp;type,&nbsp;[LogLevel](_hi_log.md#gaca1fd1d8935433e6ba2e3918214e07f9)&nbsp;level,&nbsp;unsigned&nbsp;int&nbsp;domain,&nbsp;const&nbsp;char&nbsp;\*tag,&nbsp;const&nbsp;char&nbsp;\*fmt,...)&nbsp;__attribute__((__format__(os_log | int<br/>写日志接口。 | | [OH_LOG_Print](_hi_log.md#oh_log_print) ([LogType](_hi_log.md#logtype) type, [LogLevel](_hi_log.md#loglevel) level, unsigned int domain, const char \*tag, const char \*fmt,...) __attribute__((__format__(os_log | 写日志接口。 |
| [OH_LOG_IsLoggable](_hi_log.md#gabba82e8c08cf8941e4af54941eeda257)&nbsp;(unsigned&nbsp;int&nbsp;domain,&nbsp;const&nbsp;char&nbsp;\*tag,&nbsp;[LogLevel](_hi_log.md#gaca1fd1d8935433e6ba2e3918214e07f9)&nbsp;level) | int&nbsp;bool<br/>检查指定业务领域、TAG、级别的日志是否可以打印。 | | [OH_LOG_IsLoggable](_hi_log.md#oh_log_isloggable) (unsigned int domain, const char \*tag, [LogLevel](_hi_log.md#loglevel) level) | 检查指定业务领域、TAG、级别的日志是否可以打印。 |
# native_buffer.h
## 概述
定义获取和使用NativeBuffer的相关函数。
**自从:**
9
**相关模块:**
[OH_NativeBuffer](_o_h___native_buffer.md)
## 汇总
### 结构体
| 结构体名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。 |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Alloc](_o_h___native_buffer.md#oh_nativebuffer_alloc) (const [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例。 |
| [OH_NativeBuffer_Reference](_o_h___native_buffer.md#oh_nativebuffer_reference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数加1。 |
| [OH_NativeBuffer_Unreference](_o_h___native_buffer.md#oh_nativebuffer_unreference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉。 |
| [OH_NativeBuffer_GetConfig](_o_h___native_buffer.md#oh_nativebuffer_getconfig) (OH_NativeBuffer \*buffer, [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 用于获取OH_NativeBuffer的属性。 |
| [OH_NativeBuffer_Map](_o_h___native_buffer.md#oh_nativebuffer_map) (OH_NativeBuffer \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间。 |
| [OH_NativeBuffer_Unmap](_o_h___native_buffer.md#oh_nativebuffer_unmap) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除。 |
| [OH_NativeBuffer_GetSeqNum](_o_h___native_buffer.md#oh_nativebuffer_getseqnum) (OH_NativeBuffer \*buffer) | 获取OH_NativeBuffer的序列号。 |
# native_image.h
## 概述
定义获取和使用NativeImage的相关函数。
**自从:**
9
**相关模块:**
[OH_NativeImage](_o_h___native_image.md)
## 汇总
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeImage_Create](_o_h___native_image.md#oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联. |
| [OH_NativeImage_AcquireNativeWindow](_o_h___native_image.md#oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放. |
| [OH_NativeImage_AttachContext](_o_h___native_image.md#oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OPENGL ES上下文, 且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新. |
| [OH_NativeImage_DetachContext](_o_h___native_image.md#oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OPENGL ES上下文分离. |
| [OH_NativeImage_UpdateSurfaceImage](_o_h___native_image.md#oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理. |
| [OH_NativeImage_GetTimestamp](_o_h___native_image.md#oh_nativeimage_gettimestamp) (OH_NativeImage \*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳. |
| [OH_NativeImage_GetTransformMatrix](_o_h___native_image.md#oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵. |
| [OH_NativeImage_Destroy](_o_h___native_image.md#oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空. |
# native_interface_bundle.h
## **Overview**
**Related Modules:**
[Native_Bundle](_native___bundle.md)
**Description:**
Declares the **Bundle**-specific function, including function for obtaining application ID.
**Since:**
9
**Version:**
1.0
## **Summary**
### Functions
| Function | Description |
| -------- | -------- |
| [OH_NativeBundle_GetAppIdByBundleName](_native___bundle.md#gaa407fb88995597480c5584cce1fb14bd)&nbsp;(const&nbsp;char&nbsp;\*bundleName) | char&nbsp;\*<br/>Obtains&nbsp;the&nbsp;application&nbsp;ID&nbsp;based&nbsp;on&nbsp;the&nbsp;given&nbsp;bundle&nbsp;name. |
# native_interface_xcomponent.h # native_interface_xcomponent.h
## **Overview** ## 概述
**Related Modules:** 声明用于访问Native XComponent的API。
[Native XComponent](_o_h___native_x_component.md) **自从:**
**Description:** 8
Declares APIs for accessing a Native XComponent. **相关模块:**
[Native XComponent](_o_h___native_x_component.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Classes ### 结构体
| Classe&nbsp;Name | Description | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | | | [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | 触摸事件中触摸点的信息。 |
| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | | | [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | 触摸事件。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers&nbsp;the&nbsp;surface&nbsp;lifecycle&nbsp;and&nbsp;touch&nbsp;event&nbsp;callbacks. | | [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) | 鼠标事件。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | 注册surface生命周期和触摸事件回调。 |
| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) | 注册鼠标事件的回调。 |
### Macros ### 类型定义
| Macro&nbsp;Name&nbsp;and&nbsp;Value | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| **OH_NATIVE_XCOMPONENT_OBJ**&nbsp;&nbsp;&nbsp;("__NATIVE_XCOMPONENT_OBJ__") | | | [OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) | 提供封装的OH_NativeXComponent实例。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component.md#oh_nativexcomponent_callback) | 注册surface生命周期和触摸事件回调。 |
| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component.md#oh_nativexcomponent_mouseevent_callback) | 注册鼠标事件的回调。 |
### Typedefs ### 枚举
| Typedef&nbsp;Name | Description | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1) | typedef&nbsp;struct&nbsp;[OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)<br/>Provides&nbsp;an&nbsp;encapsulated&nbsp;**OH_NativeXComponent**&nbsp;instance. | | { OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, <br/>OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, <br/>OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, <br/>OHOS_IMAGE_RESULT_SUCCESS = 0, <br/>OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | [枚举](_o_h___native_x_component.md#anonymous-enum)API访问状态。 |
| [OH_NativeXComponent_Callback](_o_h___native_x_component.md#gaf629ecc5d06f0a69aea9da3511679ea5) | typedef&nbsp;struct&nbsp;[OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)<br/>Registers&nbsp;the&nbsp;surface&nbsp;lifecycle&nbsp;and&nbsp;touch&nbsp;event&nbsp;callbacks. | | [OH_NativeXComponent_TouchEventType](_o_h___native_x_component.md#oh_nativexcomponent_toucheventtype) { <br/>OH_NATIVEXCOMPONENT_DOWN = 0, <br/>OH_NATIVEXCOMPONENT_UP, <br/>OH_NATIVEXCOMPONENT_MOVE, <br/>OH_NATIVEXCOMPONENT_CANCEL,<br/>OH_NATIVEXCOMPONENT_UNKNOWN } | 触摸事件类型。 |
| [OH_NativeXComponent_MouseEventAction](_o_h___native_x_component.md#oh_nativexcomponent_mouseeventaction) { <br/>OH_NATIVEXCOMPONENT_MOUSE_NONE = 0, <br/>OH_NATIVEXCOMPONENT_MOUSE_PRESS, <br/>OH_NATIVEXCOMPONENT_MOUSE_RELEASE, <br/>OH_NATIVEXCOMPONENT_MOUSE_MOVE } | 鼠标事件动作。 |
| [OH_NativeXComponent_MouseEventButton](_o_h___native_x_component.md#oh_nativexcomponent_mouseeventbutton) { <br/>OH_NATIVEXCOMPONENT_NONE_BUTTON = 0, <br/>OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01, <br/>OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02, <br/>OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04, <br/>OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08, <br/>OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10 } | 鼠标事件按键。 |
### Enumerations ### 函数
| Enumeration&nbsp;Name | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| {&nbsp;[OH_NATIVEXCOMPONENT_RESULT_SUCCESS](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55baf2a815b270113979adea7b9440e0b80e)&nbsp;=&nbsp;0,&nbsp;[OH_NATIVEXCOMPONENT_RESULT_FAILED](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55bad6e4a33f3c594e267b8101bbc8ba682f)&nbsp;=&nbsp;-1,&nbsp;[OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER](_o_h___native_x_component.md#gga06fc87d81c62e9abb8790b6e5713c55baa12565a3677df7c8dc60e216ed40e580)&nbsp;=&nbsp;-2&nbsp;} | Enumerates&nbsp;the&nbsp;API&nbsp;access&nbsp;states. | | [OH_NativeXComponent_GetXComponentId](_o_h___native_x_component.md#oh_nativexcomponent_getxcomponentid) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, char \*id, uint64_t \*size) | 获取ArkUI XComponent的id。 |
| [OH_NativeXComponent_TouchEventType](_o_h___native_x_component.md#ga0a8c68dd460d7e801e7c0ff771f09182)&nbsp;{&nbsp;&nbsp;&nbsp;[OH_NATIVEXCOMPONENT_DOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a87b4dfe82e5aafd40c202484fc10dfb4)&nbsp;=&nbsp;0,&nbsp;[OH_NATIVEXCOMPONENT_UP](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182ae2da3fbb127398f9a749070edf671597),&nbsp;[OH_NATIVEXCOMPONENT_MOVE](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a0b97e9e7830d0363e3617e2a7d33b378),&nbsp;[OH_NATIVEXCOMPONENT_CANCEL](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182a8593a5e1053e9c9df74d6b0e8a9bbb0a),&nbsp;&nbsp;&nbsp;[OH_NATIVEXCOMPONENT_UNKNOWN](_o_h___native_x_component.md#gga0a8c68dd460d7e801e7c0ff771f09182aff39d23c1412b3b110a19df4893651d3)&nbsp;} | | | [OH_NativeXComponent_GetXComponentSize](_o_h___native_x_component.md#oh_nativexcomponent_getxcomponentsize) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, const void \*window, uint64_t \*width, uint64_t \*height) | 获取ArkUI XComponent持有的surface的大小。 |
| [OH_NativeXComponent_GetXComponentOffset](_o_h___native_x_component.md#oh_nativexcomponent_getxcomponentoffset) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, const void \*window, double \*x, double \*y) | 获取ArkUI XComponent组件相对屏幕左上顶点的偏移量。 |
| [OH_NativeXComponent_GetTouchEvent](_o_h___native_x_component.md#oh_nativexcomponent_gettouchevent) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) \*touchEvent) | 获取ArkUI XComponent调度的触摸事件。 |
| [OH_NativeXComponent_GetMouseEvent](_o_h___native_x_component.md#oh_nativexcomponent_getmouseevent) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) \*mouseEvent) | 获取ArkUI XComponent调度的鼠标事件 |
| [OH_NativeXComponent_RegisterCallback](_o_h___native_x_component.md#oh_nativexcomponent_registercallback) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) \*callback) | 为此OH_NativeXComponent实例注册回调。 |
| [OH_NativeXComponent_RegisterMouseEventCallback](_o_h___native_x_component.md#oh_nativexcomponent_registermouseeventcallback) ([OH_NativeXComponent](_o_h___native_x_component.md#oh_nativexcomponent) \*component, [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) \*callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 |
### Functions ### 变量
| Function | Description | | 变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeXComponent_GetXComponentId](_o_h___native_x_component.md#ga1aa5d0ac3778b9caef35f93b54a6f677)&nbsp;([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;char&nbsp;\*id,&nbsp;uint64_t&nbsp;\*size) | int32_t<br/>Obtains&nbsp;the&nbsp;ID&nbsp;of&nbsp;the&nbsp;ArkUI&nbsp;XComponent. | | **OH_XCOMPONENT_ID_LEN_MAX** = 128 | ArkUI XComponent的id的最大长度。 |
| [OH_NativeXComponent_GetXComponentSize](_o_h___native_x_component.md#ga8f60375298a5d9eae57d03d4c5cf5f3f)&nbsp;([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;uint64_t&nbsp;\*width,&nbsp;uint64_t&nbsp;\*height) | int32_t<br/>Obtains&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;surface&nbsp;held&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. | | **OH_MAX_TOUCH_POINTS_NUMBER** = 10 | 触摸事件中的可识别的触摸点个数最大值。 |
| [OH_NativeXComponent_GetXComponentOffset](_o_h___native_x_component.md#ga3a594868e2d0f633026b7fea2f45812a)&nbsp;([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;double&nbsp;\*x,&nbsp;double&nbsp;\*y) | int32_t<br/>Obtains&nbsp;the&nbsp;offset&nbsp;of&nbsp;the&nbsp;surface&nbsp;held&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| [OH_NativeXComponent_GetTouchEvent](_o_h___native_x_component.md#ga5b0e85c74dab846b5b61a5e244ee60ca)&nbsp;([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;const&nbsp;void&nbsp;\*window,&nbsp;[OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md)&nbsp;\*touchEvent) | int32_t<br/>Obtains&nbsp;the&nbsp;touch&nbsp;event&nbsp;dispatched&nbsp;by&nbsp;the&nbsp;ArkUI&nbsp;XComponent. |
| [OH_NativeXComponent_RegisterCallback](_o_h___native_x_component.md#gaf9b8b470cd51ac0e339710926bca72e3)&nbsp;([OH_NativeXComponent](_o_h___native_x_component.md#ga0e676460ec145b81bdb07a97a368a5f1)&nbsp;\*component,&nbsp;[OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)&nbsp;\*callback) | int32_t<br/>Registers&nbsp;a&nbsp;callback&nbsp;for&nbsp;this&nbsp;**OH_NativeXComponent**&nbsp;instance. |
# native_vsync.h
## 概述
定义获取和使用NativeVsync的相关函数。
**自从:**
8
**相关模块:**
[NativeVsync](_native_vsync.md)
## 汇总
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_NativeVSync_Create](_native_vsync.md#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例。 |
| [OH_NativeVSync_Destroy](_native_vsync.md#oh_nativevsync_destroy) (OH_NativeVSync \*nativeVsync) | 销毁OH_NativeVSync实例。 |
| [OH_NativeVSync_RequestFrame](_native_vsync.md#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback。 |
# raw_dir.h # raw_dir.h
## **Overview** ## 概述
**Related Modules:** 提供rawfile目录相关功能。
[Rawfile](rawfile.md) 功能包括遍历和关闭rawfile目录。
**Description:** **自从:**
提供rawfile目录相关功能 8
功能包括遍历和关闭rawfile目录 **相关模块:**
[Rawfile](rawfile.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Typedefs ### 类型定义
| Typedef&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3) | typedef&nbsp;struct&nbsp;[RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)<br/>提供对rawfile目录的访问 | | [RawDir](rawfile.md#rawdir) | 提供对rawfile目录的访问 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_ResourceManager_GetRawFileName](rawfile.md#gaf522ad160d8ca2bd476b6ad45696e1af)&nbsp;([RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)&nbsp;\*rawDir,&nbsp;int&nbsp;index) | const&nbsp;char&nbsp;\*<br/>通过索引获取rawfile文件名称 | | [OH_ResourceManager_GetRawFileName](rawfile.md#oh_resourcemanager_getrawfilename) ([RawDir](rawfile.md#rawdir) \*rawDir, int index) | 通过索引获取rawfile文件名称 |
| [OH_ResourceManager_GetRawFileCount](rawfile.md#ga604cd2ced1bf4a0d1ace7b0fc89cb884)&nbsp;([RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)&nbsp;\*rawDir) | int<br/>获取[RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)中的rawfile数量 | | [OH_ResourceManager_GetRawFileCount](rawfile.md#oh_resourcemanager_getrawfilecount) ([RawDir](rawfile.md#rawdir) \*rawDir) | 获取[RawDir](rawfile.md#rawdir)中的rawfile数量 |
| [OH_ResourceManager_CloseRawDir](rawfile.md#ga1db0825028507d355db4067f187223de)&nbsp;([RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)&nbsp;\*rawDir) | void<br/>关闭已打开的[RawDir](rawfile.md#ga654d75f2b4badf0dac10c4127a9938c3)并释放所有相关联资源 | | [OH_ResourceManager_CloseRawDir](rawfile.md#oh_resourcemanager_closerawdir) ([RawDir](rawfile.md#rawdir) \*rawDir) | 关闭已打开的[RawDir](rawfile.md#rawdir)并释放所有相关联资源 |
# raw_file.h # raw_file.h
## **Overview** ## 概述
**Related Modules:** 提供rawfile文件相关功能。
[Rawfile](rawfile.md) 功能包括搜索、读取和关闭rawfile文件。
**Description:** **自从:**
提供rawfile文件相关功能 8
功能包括搜索、读取和关闭rawfile文件 **相关模块:**
[Rawfile](rawfile.md)
**Since:**
8
**Version:**
1.0
## **Summary** ## 汇总
### Classes ### 结构体
| Classe&nbsp;Name | Description | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息 | | [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息 |
### Typedefs ### 类型定义
| Typedef&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27) | typedef&nbsp;struct&nbsp;[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)<br/>提供对rawfile的访问功能 | | [RawFile](rawfile.md#rawfile) | 提供对rawfile的访问功能 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_ResourceManager_ReadRawFile](rawfile.md#ga2958ba7372ae1232365358115a82c219)&nbsp;(const&nbsp;[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile,&nbsp;void&nbsp;\*buf,&nbsp;size_t&nbsp;length) | int<br/>读取rawfile | | [OH_ResourceManager_ReadRawFile](rawfile.md#oh_resourcemanager_readrawfile) (const [RawFile](rawfile.md#rawfile) \*rawFile, void \*buf, size_t length) | 读取rawfile |
| [OH_ResourceManager_SeekRawFile](rawfile.md#ga7fc0d124fd184498b0a0bfad3454f45c)&nbsp;(const&nbsp;[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile,&nbsp;long&nbsp;offset,&nbsp;int&nbsp;whence) | int<br/>基于指定的offset,在rawfile文件内搜索读写数据的位置 | | [OH_ResourceManager_SeekRawFile](rawfile.md#oh_resourcemanager_seekrawfile) (const [RawFile](rawfile.md#rawfile) \*rawFile, long offset, int whence) | 基于指定的offset,在rawfile文件内搜索读写数据的位置 |
| [OH_ResourceManager_GetRawFileSize](rawfile.md#gafcc6036360466ab5193b7b4eba5eae50)&nbsp;([RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile) | long<br/>获取rawfile长度,单位为int32_t | | [OH_ResourceManager_GetRawFileSize](rawfile.md#oh_resourcemanager_getrawfilesize) ([RawFile](rawfile.md#rawfile) \*rawFile) | 获取rawfile长度,单位为int32_t |
| [OH_ResourceManager_CloseRawFile](rawfile.md#ga5cccee53550670a2111705d56a1d427b)&nbsp;([RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile) | void<br/>关闭已打开的[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;以及释放所有相关联资源 | | [OH_ResourceManager_CloseRawFile](rawfile.md#oh_resourcemanager_closerawfile) ([RawFile](rawfile.md#rawfile) \*rawFile) | 关闭已打开的[RawFile](rawfile.md#rawfile) 以及释放所有相关联资源 |
| [OH_ResourceManager_GetRawFileOffset](rawfile.md#ga57dc379d6df6b7c7f8e76303ad4957a4)&nbsp;(const&nbsp;[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile) | long<br/>获取rawfile当前的offset,单位为int32_t | | [OH_ResourceManager_GetRawFileOffset](rawfile.md#oh_resourcemanager_getrawfileoffset) (const [RawFile](rawfile.md#rawfile) \*rawFile) | 获取rawfile当前的offset,单位为int32_t |
| [OH_ResourceManager_GetRawFileDescriptor](rawfile.md#ga8313a7d4bb361a98ced485346a9be4b1)&nbsp;(const&nbsp;[RawFile](rawfile.md#gacf2dc23017812d7daf535b80f1a6ab27)&nbsp;\*rawFile,&nbsp;[RawFileDescriptor](_raw_file_descriptor.md)&nbsp;&amp;descriptor) | bool<br/>基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符 | | [OH_ResourceManager_GetRawFileDescriptor](rawfile.md#oh_resourcemanager_getrawfiledescriptor) (const [RawFile](rawfile.md#rawfile) \*rawFile, [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符 |
| [OH_ResourceManager_ReleaseRawFileDescriptor](rawfile.md#gabf9db7f05088a11cc311a6ef890eda6b)&nbsp;(const&nbsp;[RawFileDescriptor](_raw_file_descriptor.md)&nbsp;&amp;descriptor) | bool<br/>关闭rawfile文件描述符 | | [OH_ResourceManager_ReleaseRawFileDescriptor](rawfile.md#oh_resourcemanager_releaserawfiledescriptor) (const [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 关闭rawfile文件描述符 |
# raw_file_manager.h
## 概述
提供资源管理rawfile相关功能。
可以使用resource manager打开rawfile来进行后续相关操作,像搜索和读取等。
**自从:**
8
**相关模块:**
[Rawfile](rawfile.md)
## 汇总
### 类型定义
| 类型定义名称 | 描述 |
| -------- | -------- |
| [NativeResourceManager](rawfile.md#nativeresourcemanager) | 代表resource manager |
### 函数
| 函数名称 | 描述 |
| -------- | -------- |
| [OH_ResourceManager_InitNativeResourceManager](rawfile.md#oh_resourcemanager_initnativeresourcemanager) (napi_env env, napi_value jsResMgr) | 基于JavaScipt resource manager获取native resource manager |
| [OH_ResourceManager_ReleaseNativeResourceManager](rawfile.md#oh_resourcemanager_releasenativeresourcemanager) ([NativeResourceManager](rawfile.md#nativeresourcemanager) \*resMgr) | 释放native resource manager |
| [OH_ResourceManager_OpenRawDir](rawfile.md#oh_resourcemanager_openrawdir) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*dirName) | 打开rawfile目录 |
| [OH_ResourceManager_OpenRawFile](rawfile.md#oh_resourcemanager_openrawfile) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*fileName) | 打开rawfile文件 |
# Rawfile # Rawfile
## **Overview** 提供操作rawfile目录和rawfile文件的功能。
**Description:**
提供操作rawfile目录和rawfile文件的功能 功能包括遍历、打开、搜索、读取和关闭rawfile。
功能包括遍历、打开、搜索、读取和关闭rawfile
**Since:** **自从:**
8
**Version:**
1.0 8
## **Summary** ## 汇总
### Files ### 文件
| File&nbsp;Name | Description | | 文件名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [raw_dir.h](raw__dir_8h.md) | 提供rawfile目录相关功能 | | [raw_dir.h](raw__dir_8h.md) | 提供rawfile目录相关功能。 |
| [raw_file.h](raw__file_8h.md) | 提供rawfile文件相关功能 | | [raw_file.h](raw__file_8h.md) | 提供rawfile文件相关功能。 |
| [raw_file_manager.h](raw__file__manager_8h.md) | 提供资源管理rawfile相关功能。 |
### Classes ### 结构体
| Classe&nbsp;Name | Description | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息 | | [RawFileDescriptor](_raw_file_descriptor.md) | 提供rawfile文件描述符信息 |
### Typedefs ### 类型定义
| Typedef&nbsp;Name | Description | | 类型定义名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| RawDir | typedef&nbsp;struct&nbsp;RawDir<br/>提供对rawfile目录的访问 | | [RawDir](#rawdir) | 提供对rawfile目录的访问。 |
| RawFile | typedef&nbsp;struct&nbsp;RawFile<br/>提供对rawfile的访问功能 | | [RawFile](#rawfile) | 提供对rawfile的访问功能。 |
| NativeResourceManager | typedef&nbsp;struct&nbsp;NativeResourceManager<br/>代表resource&nbsp;manager | | [NativeResourceManager](#nativeresourcemanager) | 代表resource manager。 |
### Functions ### 函数
| Function | Description | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| OH_ResourceManager_GetRawFileName&nbsp;(RawDir&nbsp;\*rawDir,&nbsp;int&nbsp;index) | const&nbsp;char&nbsp;\*<br/>通过索引获取rawfile文件名称 | | [OH_ResourceManager_GetRawFileName](#oh_resourcemanager_getrawfilename) ([RawDir](#rawdir) \*rawDir, int index) | 通过索引获取rawfile文件名称。 |
| OH_ResourceManager_GetRawFileCount&nbsp;(RawDir&nbsp;\*rawDir) | int<br/>获取RawDir中的rawfile数量 | | [OH_ResourceManager_GetRawFileCount](#oh_resourcemanager_getrawfilecount) ([RawDir](#rawdir) \*rawDir) | 获取[RawDir](#rawdir)中的rawfile数量。 |
| OH_ResourceManager_CloseRawDir&nbsp;(RawDir&nbsp;\*rawDir) | void<br/>关闭已打开的RawDir并释放所有相关联资源 | | [OH_ResourceManager_CloseRawDir](#oh_resourcemanager_closerawdir) ([RawDir](#rawdir) \*rawDir) | 关闭已打开的[RawDir](#rawdir)并释放所有相关联资源。 |
| OH_ResourceManager_ReadRawFile&nbsp;(const&nbsp;RawFile&nbsp;\*rawFile,&nbsp;void&nbsp;\*buf,&nbsp;size_t&nbsp;length) | int<br/>读取rawfile | | [OH_ResourceManager_ReadRawFile](#oh_resourcemanager_readrawfile) (const [RawFile](#rawfile) \*rawFile, void \*buf, size_t length) | 读取rawfile。 |
| OH_ResourceManager_SeekRawFile&nbsp;(const&nbsp;RawFile&nbsp;\*rawFile,&nbsp;long&nbsp;offset,&nbsp;int&nbsp;whence) | int<br/>基于指定的offset,在rawfile文件内搜索读写数据的位置 | | [OH_ResourceManager_SeekRawFile](#oh_resourcemanager_seekrawfile) (const [RawFile](#rawfile) \*rawFile, long offset, int whence) | 基于指定的offset,在rawfile文件内搜索读写数据的位置。 |
| OH_ResourceManager_GetRawFileSize&nbsp;(RawFile&nbsp;\*rawFile) | long<br/>获取rawfile长度,单位为int32_t | | [OH_ResourceManager_GetRawFileSize](#oh_resourcemanager_getrawfilesize) ([RawFile](#rawfile) \*rawFile) | 获取rawfile长度,单位为int32_t。 |
| OH_ResourceManager_CloseRawFile&nbsp;(RawFile&nbsp;\*rawFile) | void<br/>关闭已打开的RawFile&nbsp;以及释放所有相关联资源 | | [OH_ResourceManager_CloseRawFile](#oh_resourcemanager_closerawfile) ([RawFile](#rawfile) \*rawFile) | 关闭已打开的[RawFile](#rawfile) 以及释放所有相关联资源。 |
| OH_ResourceManager_GetRawFileOffset&nbsp;(const&nbsp;RawFile&nbsp;\*rawFile) | long<br/>获取rawfile当前的offset,单位为int32_t | | [OH_ResourceManager_GetRawFileOffset](#oh_resourcemanager_getrawfileoffset) (const [RawFile](#rawfile) \*rawFile) | 获取rawfile当前的offset,单位为int32_t。 |
| OH_ResourceManager_GetRawFileDescriptor&nbsp;(const&nbsp;RawFile&nbsp;\*rawFile,&nbsp;RawFileDescriptor&nbsp;&amp;descriptor) | bool<br/>基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符 | | [OH_ResourceManager_GetRawFileDescriptor](#oh_resourcemanager_getrawfiledescriptor) (const [RawFile](#rawfile) \*rawFile, [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符。 |
| OH_ResourceManager_ReleaseRawFileDescriptor&nbsp;(const&nbsp;RawFileDescriptor&nbsp;&amp;descriptor) | bool<br/>关闭rawfile文件描述符 | | [OH_ResourceManager_ReleaseRawFileDescriptor](#oh_resourcemanager_releaserawfiledescriptor) (const [RawFileDescriptor](_raw_file_descriptor.md) &amp;descriptor) | 关闭rawfile文件描述符。 |
| OH_ResourceManager_InitNativeResourceManager&nbsp;(napi_env&nbsp;env,&nbsp;napi_value&nbsp;jsResMgr) | NativeResourceManager&nbsp;\*<br/>基于JavaScipt&nbsp;resource&nbsp;manager获取native&nbsp;resource&nbsp;manager | | [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager) (napi_env env, napi_value jsResMgr) | 基于JavaScipt resource manager获取native resource manager。 |
| OH_ResourceManager_ReleaseNativeResourceManager&nbsp;(NativeResourceManager&nbsp;\*resMgr) | void<br/>释放native&nbsp;resource&nbsp;manager | | [OH_ResourceManager_ReleaseNativeResourceManager](#oh_resourcemanager_releasenativeresourcemanager) ([NativeResourceManager](#nativeresourcemanager) \*resMgr) | 释放native resource manager。 |
| OH_ResourceManager_OpenRawDir&nbsp;(const&nbsp;NativeResourceManager&nbsp;\*mgr,&nbsp;const&nbsp;char&nbsp;\*dirName) | RawDir&nbsp;\*<br/>打开rawfile目录 | | [OH_ResourceManager_OpenRawDir](#oh_resourcemanager_openrawdir) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*dirName) | 打开rawfile目录。 |
| OH_ResourceManager_OpenRawFile&nbsp;(const&nbsp;NativeResourceManager&nbsp;\*mgr,&nbsp;const&nbsp;char&nbsp;\*fileName) | RawFile&nbsp;\*<br/>打开rawfile文件 | | [OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile) (const [NativeResourceManager](#nativeresourcemanager) \*mgr, const char \*fileName) | 打开rawfile文件。 |
## **Details** ## 详细描述
## **Typedef** ## 类型定义说明
### NativeResourceManager ### NativeResourceManager
...@@ -78,11 +74,15 @@ ...@@ -78,11 +74,15 @@
typedef struct NativeResourceManager NativeResourceManager typedef struct NativeResourceManager NativeResourceManager
``` ```
**Description:** **描述:**
代表resource manager 代表resource manager
此类封装了JavaScript resource manager的native实现 **ResourceManager**指针可以通过调用OH_ResourceManager_InitNativeResourceManager方法获取 此类封装了JavaScript resource manager的native实现 **ResourceManager**指针可以通过调用[OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取
**自从:**
8
### RawDir ### RawDir
...@@ -92,9 +92,13 @@ typedef struct NativeResourceManager NativeResourceManager ...@@ -92,9 +92,13 @@ typedef struct NativeResourceManager NativeResourceManager
typedef struct RawDir RawDir typedef struct RawDir RawDir
``` ```
**Description:** **描述:**
提供对rawfile目录的访问。
提供对rawfile目录的访问 **自从:**
8
### RawFile ### RawFile
...@@ -104,12 +108,16 @@ typedef struct RawDir RawDir ...@@ -104,12 +108,16 @@ typedef struct RawDir RawDir
typedef struct RawFile RawFile typedef struct RawFile RawFile
``` ```
**Description:** **描述:**
提供对rawfile的访问功能 提供对rawfile的访问功能
**自从:**
8
## **Function**
## 函数说明
### OH_ResourceManager_CloseRawDir() ### OH_ResourceManager_CloseRawDir()
...@@ -119,19 +127,23 @@ typedef struct RawFile RawFile ...@@ -119,19 +127,23 @@ typedef struct RawFile RawFile
void OH_ResourceManager_CloseRawDir (RawDir * rawDir) void OH_ResourceManager_CloseRawDir (RawDir * rawDir)
``` ```
**Description:** **描述:**
关闭已打开的RawDir并释放所有相关联资源 关闭已打开的[RawDir](#rawdir)并释放所有相关联资源。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawDir | 表示指向RawDir的指针 | | rawDir | 表示指向[RawDir](#rawdir)的指针。 |
**参见:**
**See also:** [OH_ResourceManager_OpenRawDir](#oh_resourcemanager_openrawdir)
OH_ResourceManager_OpenRawDir **自从:**
8
### OH_ResourceManager_CloseRawFile() ### OH_ResourceManager_CloseRawFile()
...@@ -141,19 +153,23 @@ OH_ResourceManager_OpenRawDir ...@@ -141,19 +153,23 @@ OH_ResourceManager_OpenRawDir
void OH_ResourceManager_CloseRawFile (RawFile * rawFile) void OH_ResourceManager_CloseRawFile (RawFile * rawFile)
``` ```
**Description:** **描述:**
关闭已打开的RawFile 以及释放所有相关联资源 关闭已打开的[RawFile](#rawfile) 以及释放所有相关联资源。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**参见:**
**See also:** [OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile)
OH_ResourceManager_OpenRawFile **自从:**
8
### OH_ResourceManager_GetRawFileCount() ### OH_ResourceManager_GetRawFileCount()
...@@ -163,21 +179,25 @@ OH_ResourceManager_OpenRawFile ...@@ -163,21 +179,25 @@ OH_ResourceManager_OpenRawFile
int OH_ResourceManager_GetRawFileCount (RawDir * rawDir) int OH_ResourceManager_GetRawFileCount (RawDir * rawDir)
``` ```
**Description:** **描述:**
获取RawDir中的rawfile数量 获取[RawDir](#rawdir)中的rawfile数量。
通过此方法可以获取OH_ResourceManager_GetRawFileName中可用的索引 通过此方法可以获取[OH_ResourceManager_GetRawFileName](#oh_resourcemanager_getrawfilename)中可用的索引。
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawDir | 表示指向RawDir的指针 | | rawDir | 表示指向[RawDir](#rawdir)的指针。 |
**See also:** **参见:**
OH_ResourceManager_GetRawFileName [OH_ResourceManager_GetRawFileName](#oh_resourcemanager_getrawfilename)
**自从:**
8
### OH_ResourceManager_GetRawFileDescriptor() ### OH_ResourceManager_GetRawFileDescriptor()
...@@ -187,22 +207,26 @@ OH_ResourceManager_GetRawFileName ...@@ -187,22 +207,26 @@ OH_ResourceManager_GetRawFileName
bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDescriptor & descriptor ) bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDescriptor & descriptor )
``` ```
**Description:** **描述:**
基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符 基于offset(单位为int32_t)和文件长度打开rawfile,并获取rawfile文件描述符
打开的文件描述符被用于读取rawfile 打开的文件描述符被用于读取rawfile
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| descriptor | 显示rawfile文件描述符,以及在HAP包中的起始位置和长度 | | descriptor | 显示rawfile文件描述符,以及在HAP包中的起始位置和长度 |
**Returns:** **返回:**
返回true表示打开rawfile文件描述符成功,返回false表示rawfile不允许被访问 返回true表示打开rawfile文件描述符成功,返回false表示rawfile不允许被访问。
**自从:**
8
### OH_ResourceManager_GetRawFileName() ### OH_ResourceManager_GetRawFileName()
...@@ -212,26 +236,30 @@ bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDe ...@@ -212,26 +236,30 @@ bool OH_ResourceManager_GetRawFileDescriptor (const RawFile * rawFile, RawFileDe
const char* OH_ResourceManager_GetRawFileName (RawDir * rawDir, int index ) const char* OH_ResourceManager_GetRawFileName (RawDir * rawDir, int index )
``` ```
**Description:** **描述:**
通过索引获取rawfile文件名称 通过索引获取rawfile文件名称
可以使用此方法遍历rawfile目录 可以使用此方法遍历rawfile目录
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawDir | 表示指向RawDir的指针 | | rawDir | 表示指向[RawDir](#rawdir)的指针。 |
| index | 表示文件在RawDir中的索引位置 | | index | 表示文件在[RawDir](#rawdir)中的索引位置。 |
**Returns:** **返回:**
通过索引返回文件名称,此返回值可以作为OH_ResourceManager_OpenRawFile的输入参数, 如果遍历完所有文件仍未找到,则返回**NULL** 通过索引返回文件名称,此返回值可以作为[OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile)的输入参数, 如果遍历完所有文件仍未找到,则返回**NULL**
**See also:** **参见:**
OH_ResourceManager_OpenRawFile [OH_ResourceManager_OpenRawFile](#oh_resourcemanager_openrawfile)
**自从:**
8
### OH_ResourceManager_GetRawFileOffset() ### OH_ResourceManager_GetRawFileOffset()
...@@ -241,21 +269,25 @@ OH_ResourceManager_OpenRawFile ...@@ -241,21 +269,25 @@ OH_ResourceManager_OpenRawFile
long OH_ResourceManager_GetRawFileOffset (const RawFile * rawFile) long OH_ResourceManager_GetRawFileOffset (const RawFile * rawFile)
``` ```
**Description:** **描述:**
获取rawfile当前的offset,单位为int32_t 获取rawfile当前的offset,单位为int32_t
rawfile当前的offset rawfile当前的offset
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**Returns:** **返回:**
返回rawfile当前的offset 返回rawfile当前的offset。
**自从:**
8
### OH_ResourceManager_GetRawFileSize() ### OH_ResourceManager_GetRawFileSize()
...@@ -265,19 +297,23 @@ rawfile当前的offset ...@@ -265,19 +297,23 @@ rawfile当前的offset
long OH_ResourceManager_GetRawFileSize (RawFile * rawFile) long OH_ResourceManager_GetRawFileSize (RawFile * rawFile)
``` ```
**Description:** **描述:**
获取rawfile长度,单位为int32_t 获取rawfile长度,单位为int32_t
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
**Returns:** **返回:**
Returns rawfile整体长度 Returns rawfile整体长度。
**自从:**
8
### OH_ResourceManager_InitNativeResourceManager() ### OH_ResourceManager_InitNativeResourceManager()
...@@ -287,22 +323,26 @@ Returns rawfile整体长度 ...@@ -287,22 +323,26 @@ Returns rawfile整体长度
NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env env, napi_value jsResMgr ) NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env env, napi_value jsResMgr )
``` ```
**Description:** **描述:**
基于JavaScipt resource manager获取native resource manager 基于JavaScipt resource manager获取native resource manager
通过获取resource manager来完成rawfile相关功能 通过获取resource manager来完成rawfile相关功能
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| env | 表示JavaScipt&nbsp;Native&nbsp;Interface&nbsp;(napi)环境指针 | | env | 表示JavaScipt Native Interface (napi)环境指针。 |
| jsResMgr | 表示JavaScipt&nbsp;resource&nbsp;manager | | jsResMgr | 表示JavaScipt resource manager。 |
**返回:**
**Returns:** 返回[NativeResourceManager](#nativeresourcemanager)指针。
返回NativeResourceManager指针 **自从:**
8
### OH_ResourceManager_OpenRawDir() ### OH_ResourceManager_OpenRawDir()
...@@ -312,28 +352,32 @@ NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env en ...@@ -312,28 +352,32 @@ NativeResourceManager* OH_ResourceManager_InitNativeResourceManager (napi_env en
RawDir* OH_ResourceManager_OpenRawDir (const NativeResourceManager * mgr, const char * dirName ) RawDir* OH_ResourceManager_OpenRawDir (const NativeResourceManager * mgr, const char * dirName )
``` ```
**Description:** **描述:**
打开rawfile目录 打开rawfile目录
打开rawfile目录后,可以遍历对应目录下的rawfile文件 打开rawfile目录后,可以遍历对应目录下的rawfile文件
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| mgr | 表示指向NativeResourceManager的指针,此指针是通过调用&nbsp;OH_ResourceManager_InitNativeResourceManager方法获取的 | | mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| dirName | 表示要打开的rawfile目录名称,当传递一个空字符串时表示打开rawfile根目录 | | dirName | 表示要打开的rawfile目录名称,当传递一个空字符串时表示打开rawfile根目录 |
**Returns:** **返回:**
返回RawDir指针。使用完此指针后,调用OH_ResourceManager_CloseRawDir释放。 返回[RawDir](#rawdir)指针。使用完此指针后,调用[OH_ResourceManager_CloseRawDir](#oh_resourcemanager_closerawdir)释放。
**See also:** **参见:**
OH_ResourceManager_InitNativeResourceManager [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)
OH_ResourceManager_CloseRawDir [OH_ResourceManager_CloseRawDir](#oh_resourcemanager_closerawdir)
**自从:**
8
### OH_ResourceManager_OpenRawFile() ### OH_ResourceManager_OpenRawFile()
...@@ -343,28 +387,32 @@ OH_ResourceManager_CloseRawDir ...@@ -343,28 +387,32 @@ OH_ResourceManager_CloseRawDir
RawFile* OH_ResourceManager_OpenRawFile (const NativeResourceManager * mgr, const char * fileName ) RawFile* OH_ResourceManager_OpenRawFile (const NativeResourceManager * mgr, const char * fileName )
``` ```
**Description:** **描述:**
打开rawfile文件 打开rawfile文件
当打开rawfile以后,可以读取它的数据 当打开rawfile以后,可以读取它的数据
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| mgr | 表示指向NativeResourceManager的指针,此指针是通过调用&nbsp;OH_ResourceManager_InitNativeResourceManager方法获取的 | | mgr | 表示指向[NativeResourceManager](#nativeresourcemanager)的指针,此指针是通过调用 [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)方法获取的。 |
| fileName | 表示基于rawfile根目录的相对路径下的文件名称 | | fileName | 表示基于rawfile根目录的相对路径下的文件名称。 |
**返回:**
**Returns:** 返回[RawFile](#rawfile)指针。当使用完此指针,调用[OH_ResourceManager_CloseRawFile](#oh_resourcemanager_closerawfile)释放。
返回RawFile指针。当使用完此指针,调用OH_ResourceManager_CloseRawFile释放。 **参见:**
**See also:** [OH_ResourceManager_InitNativeResourceManager](#oh_resourcemanager_initnativeresourcemanager)
OH_ResourceManager_InitNativeResourceManager [OH_ResourceManager_CloseRawFile](#oh_resourcemanager_closerawfile)
OH_ResourceManager_CloseRawFile **自从:**
8
### OH_ResourceManager_ReadRawFile() ### OH_ResourceManager_ReadRawFile()
...@@ -374,23 +422,27 @@ OH_ResourceManager_CloseRawFile ...@@ -374,23 +422,27 @@ OH_ResourceManager_CloseRawFile
int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t length ) int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t length )
``` ```
**Description:** **描述:**
读取rawfile 读取rawfile
从当前位置读取**指定长度**的数据 从当前位置读取**指定长度**的数据
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| buf | 用于接收读取数据的缓冲区指针 | | buf | 用于接收读取数据的缓冲区指针。 |
| length | 读取数据的字节长度 | | length | 读取数据的字节长度。 |
**返回:**
**Returns:** 返回读取的字节数,如果读取长度超过文件末尾长度,则返回**0**
返回读取的字节数,如果读取长度超过文件末尾长度,则返回**0** **自从:**
8
### OH_ResourceManager_ReleaseNativeResourceManager() ### OH_ResourceManager_ReleaseNativeResourceManager()
...@@ -400,15 +452,19 @@ int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t ...@@ -400,15 +452,19 @@ int OH_ResourceManager_ReadRawFile (const RawFile * rawFile, void * buf, size_t
void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * resMgr) void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * resMgr)
``` ```
**Description:** **描述:**
释放native resource manager 释放native resource manager
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| resMgr | 表示NativeResourceManager指针 | | resMgr | 表示[NativeResourceManager](#nativeresourcemanager)指针。 |
**自从:**
8
### OH_ResourceManager_ReleaseRawFileDescriptor() ### OH_ResourceManager_ReleaseRawFileDescriptor()
...@@ -418,21 +474,25 @@ void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * re ...@@ -418,21 +474,25 @@ void OH_ResourceManager_ReleaseNativeResourceManager (NativeResourceManager * re
bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & descriptor) bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & descriptor)
``` ```
**Description:** **描述:**
关闭rawfile文件描述符 关闭rawfile文件描述符
已打开的文件描述符在使用完以后必须释放,防止文件描述符泄露 已打开的文件描述符在使用完以后必须释放,防止文件描述符泄露
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| descriptor | 包含rawfile文件描述符,以及在HAP包中的起始位置和长度 | | descriptor | 包含rawfile文件描述符,以及在HAP包中的起始位置和长度 |
**Returns:** **返回:**
返回true表示关闭文件描述符成功,返回false表示关闭文件描述符失败 返回true表示关闭文件描述符成功,返回false表示关闭文件描述符失败。
**自从:**
8
### OH_ResourceManager_SeekRawFile() ### OH_ResourceManager_SeekRawFile()
...@@ -442,18 +502,22 @@ bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & desc ...@@ -442,18 +502,22 @@ bool OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor & desc
int OH_ResourceManager_SeekRawFile (const RawFile * rawFile, long offset, int whence ) int OH_ResourceManager_SeekRawFile (const RawFile * rawFile, long offset, int whence )
``` ```
**Description:** **描述:**
基于指定的offset,在rawfile文件内搜索读写数据的位置 基于指定的offset,在rawfile文件内搜索读写数据的位置
**Parameters:** **参数:**
| Name | Description | | Name | 描述 |
| -------- | -------- | | -------- | -------- |
| rawFile | 表示指向RawFile的指针 | | rawFile | 表示指向[RawFile](#rawfile)的指针。 |
| offset | 表示指定的offset | | offset | 表示指定的offset |
| whence | 读写位置,有以下场景:&nbsp;**0**:&nbsp;读写位置为**offset1**:&nbsp;读写位置为当前位置加上**offset2**:&nbsp;读写位置为文件末尾(EOF)加上**offset** | | whence | 读写位置,有以下场景:<br/>**0**: 读写位置为**offset**<br/>**1**: 读写位置为当前位置加上**offset2**: 读写位置为文件末尾(EOF)加上**offset** |
**Returns:** **返回:**
如果搜索成功返回新的读写位置,如果发生错误返回 **(long) -1** 如果搜索成功返回新的读写位置,如果发生错误返回 **(long) -1**
**自从:**
8
...@@ -938,10 +938,11 @@ ...@@ -938,10 +938,11 @@
- 接口参考(Native API) - 接口参考(Native API)
- 模块 - 模块
- [Native XComponent](reference/native-apis/_o_h___native_x_component.md) - [Native XComponent](reference/native-apis/_o_h___native_x_component.md)
- [Native_Bundle](reference/native-apis/_native___bundle.md)
- [HiLog](reference/native-apis/_hi_log.md) - [HiLog](reference/native-apis/_hi_log.md)
- [NativeWindow](reference/native-apis/_native_window.md) - [NativeWindow](reference/native-apis/_native_window.md)
- [Drawing](reference/native-apis/_drawing.md) - [Drawing](reference/native-apis/_drawing.md)
- [OH_NativeImage](reference/native-apis/_o_h___native_image.md)
- [NativeVsync](reference/native-apis/_native_vsync.md)
- [Rawfile](reference/native-apis/rawfile.md) - [Rawfile](reference/native-apis/rawfile.md)
- 头文件 - 头文件
- [drawing_bitmap.h](reference/native-apis/drawing__bitmap_8h.md) - [drawing_bitmap.h](reference/native-apis/drawing__bitmap_8h.md)
...@@ -955,16 +956,24 @@ ...@@ -955,16 +956,24 @@
- [drawing_text_typography.h](reference/native-apis/drawing__text__typography_8h.md) - [drawing_text_typography.h](reference/native-apis/drawing__text__typography_8h.md)
- [drawing_types.h](reference/native-apis/drawing__types_8h.md) - [drawing_types.h](reference/native-apis/drawing__types_8h.md)
- [external_window.h](reference/native-apis/external__window_8h.md) - [external_window.h](reference/native-apis/external__window_8h.md)
- [image_pixel_map_napi.h](reference/native-apis/image__pixel__map__napi_8h.md)
- [log.h](reference/native-apis/log_8h.md) - [log.h](reference/native-apis/log_8h.md)
- [native_interface_bundle.h](reference/native-apis/native__interface__bundle_8h.md) - [native_buffer.h](reference/native-apis/native__buffer_8h.md)
- [native_image.h](reference/native-apis/native__image_8h.md)
- [native_interface_xcomponent.h](reference/native-apis/native__interface__xcomponent_8h.md) - [native_interface_xcomponent.h](reference/native-apis/native__interface__xcomponent_8h.md)
- [native_vsync.h](reference/native-apis/native__vsync_8h.md)
- [raw_dir.h](reference/native-apis/raw__dir_8h.md) - [raw_dir.h](reference/native-apis/raw__dir_8h.md)
- [raw_file_manager.h](reference/native-apis/raw__file__manager_8h.md)
- [raw_file.h](reference/native-apis/raw__file_8h.md) - [raw_file.h](reference/native-apis/raw__file_8h.md)
- 结构体 - 结构体
- [OH_Drawing_BitmapFormat](reference/native-apis/_o_h___drawing___bitmap_format.md) - [OH_Drawing_BitmapFormat](reference/native-apis/_o_h___drawing___bitmap_format.md)
- [OH_NativeBuffer_Config](reference/native-apis/_o_h___native_buffer___config.md)
- [OH_NativeXComponent_Callback](reference/native-apis/_o_h___native_x_component___callback.md) - [OH_NativeXComponent_Callback](reference/native-apis/_o_h___native_x_component___callback.md)
- [OH_NativeXComponent_MouseEvent](reference/native-apis/_o_h___native_x_component___mouse_event.md)
- [OH_NativeXComponent_MouseEvent_Callback](reference/native-apis/_o_h___native_x_component___mouse_event___callback.md)
- [OH_NativeXComponent_TouchEvent](reference/native-apis/_o_h___native_x_component___touch_event.md) - [OH_NativeXComponent_TouchEvent](reference/native-apis/_o_h___native_x_component___touch_event.md)
- [OH_NativeXComponent_TouchPoint](reference/native-apis/_o_h___native_x_component___touch_point.md) - [OH_NativeXComponent_TouchPoint](reference/native-apis/_o_h___native_x_component___touch_point.md)
- [OhosPixelMapInfo](reference/native-apis/_ohos_pixel_map_info.md)
- [RawFileDescriptor](reference/native-apis/_raw_file_descriptor.md) - [RawFileDescriptor](reference/native-apis/_raw_file_descriptor.md)
- 标准库 - 标准库
- [Node_API](reference/native-lib/third_party_napi/napi.md) - [Node_API](reference/native-lib/third_party_napi/napi.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册