1# Drawing 2 3 4## Overview 5 6The Drawing module provides the functions for 2D graphics rendering, text drawing, and image display. It uses the physical pixel unit, px. The module operates under a single-threaded model. The caller needs to manage thread safety and context state transitions. 7 8**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9 10**Since**: 8 11 12 13## Summary 14 15 16### Files 17 18| Name| Description| 19| -------- | -------- | 20| [drawing_bitmap.h](drawing__bitmap_8h.md) | Declares the functions related to the bitmap in the drawing module.| 21| [drawing_brush.h](drawing__brush_8h.md) | Declares the functions related to the brush in the drawing module.| 22| [drawing_canvas.h](drawing__canvas_8h.md) | Declares the functions related to the canvas in the drawing module. By default, the canvas has a black brush with anti-aliasing enabled but no any other style. This default brush takes effect only when no brush or pen is proactively set in the canvas. Canvases that are not set for recording will immediately draw the commands onto the bound bitmap, whereas canvases designated for recording will store the drawing commands for future replay.| 23| [drawing_color.h](drawing__color_8h.md) | Declares the functions related to the color in the drawing module.| 24| [drawing_color_filter.h](drawing__color__filter_8h.md) | Declares the functions related to the color filter in the drawing module.| 25| [drawing_error_code.h](drawing__error__code_8h.md) | Declares the functions related to the error code in the drawing module.| 26| [drawing_color_space.h](drawing__color__space_8h.md) | Declares the functions related to the color space in the drawing module.| 27| [drawing_filter.h](drawing__filter_8h.md) | Declares the functions related to the filter in the drawing module.| 28| [drawing_font.h](drawing__font_8h.md) | Declares the functions related to the font in the drawing module.| 29| [drawing_font_collection.h](drawing__font__collection_8h.md) | Declares the functions related to the font collection in the drawing module.| 30| [drawing_font_mgr.h](drawing__font__mgr_8h.md) | Declares the functions related to font management in the drawing module. The functions can be used to load fonts and match available fonts in the system.| 31| [drawing_gpu_context.h](drawing__gpu__context_8h.md) | Declares the functions related to the GPU context in the drawing module.| 32| [drawing_image.h](drawing__image_8h.md) | Declares the functions related to the image in the drawing module.| 33| [drawing_image_filter.h](drawing__image__filter_8h.md) | Declares the functions related to the image filter in the drawing module.| 34| [drawing_mask_filter.h](drawing__mask__filter_8h.md) | Declares the functions related to the mask filter in the drawing module.| 35| [drawing_matrix.h](drawing__matrix_8h.md) | Declares the functions related to the matrix in the drawing module.| 36| [drawing_memory_stream.h](drawing__memory__stream_8h.md) | Declares the functions related to the memory stream in the drawing module.| 37| [drawing_path.h](drawing__path_8h.md) | Declares the functions related to the path in the drawing module.| 38| [drawing_path_effect.h](drawing__path__effect_8h.md) | Declares the functions related to the bitmap in the drawing module.| 39| [drawing_pen.h](drawing__pen_8h.md) | Declares the functions related to the pen in the drawing module.| 40| [drawing_pixel_map.h](drawing__pixel__map_8h.md) | Declares the functions related to the pixel map in the drawing module.| 41| [drawing_point.h](drawing__point_8h.md) | Declares the functions related to the coordinate point in the drawing module.| 42| [drawing_record_cmd.h](drawing__record__cmd_8h.md) | Declares the functions related to a recording command object.| 43| [drawing_rect.h](drawing__rect_8h.md) | Declares the functions related to the rectangle in the drawing module.| 44| [drawing_region.h](drawing__region_8h.md) | Declares the functions related to the region in the drawing module, including creating a region, setting the boundary, and destroying a region.| 45| [drawing_register_font.h](drawing__register__font_8h.md) | Declares the functions related to the font manager in the drawing module.| 46| [drawing_round_rect.h](drawing__round__rect_8h.md) | Declares the functions related to the rounded rectangle in the drawing module.| 47| [drawing_sampling_options.h](drawing__sampling__options_8h.md) | Declares the functions related to the sampling options in the drawing module. It is used for image or texture sampling.| 48| [drawing_shader_effect.h](drawing__shader__effect_8h.md) | Declares the functions related to the shader effect in the drawing module.| 49| [drawing_shadow_layer.h](drawing__shadow__layer_8h.md) | Declares the functions related to the shadow in the drawing module.| 50| [drawing_surface.h](drawing__surface_8h.md) | Declares the functions related to the surface in the drawing module, including creating, destroying, and using the surface.| 51| [drawing_text_blob.h](drawing__text__blob_8h.md) | Declares the functions related to the text blob in the drawing module.| 52| [drawing_text_declaration.h](drawing__text__declaration_8h.md) | Declares the structs related to text in 2D drawing.| 53| [drawing_text_font_descriptor.h](drawing__text__font__descriptor_8h.md) | Declares the capabilities of font information, such as obtaining font information and searching for a font.| 54| [drawing_text_typography.h](drawing__text__typography_8h.md) | Declares the functions related to typography in the drawing module.| 55| [drawing_typeface.h](drawing__typeface_8h.md) | Declares the functions related to the typeface in the drawing module. Different platforms have their own default typefaces. You can also parse the .ttf file to obtain the typefaces specified by the third party, such as SimSun and SimHei.| 56| [drawing_types.h](drawing__types_8h.md) | Declares the data types of the canvas, brush, pen, bitmap, and path used to draw 2D graphics.| 57 58 59### Structs 60 61| Name| Description| 62| -------- | -------- | 63| struct [OH_Drawing_String](_o_h___drawing___string.md) | Describes a string of characters encoded in UTF-16.| 64| struct [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | Describes the pixel format of a bitmap, including the color type and alpha type.| 65| struct [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) | Describes the measurement information about a font.| 66| struct [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md) | Describes the options about the GPU context.| 67| struct [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md) | Describes a run, which provides storage for glyphs and positions.| 68| struct [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) | Describes the placeholder that acts as a span.| 69| struct [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Describes the detailed information about a system font.| 70| struct [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Describes the measurement information about a line of text.| 71| struct [OH_Drawing_FontFallbackInfo](_o_h___drawing___font_fallback_info.md) | Describes the information about a font fallback.| 72| struct [OH_Drawing_FontFallbackGroup](_o_h___drawing___font_fallback_group.md) | Describes the information about a font fallback group.| 73| struct [OH_Drawing_FontAdjustInfo](_o_h___drawing___font_adjust_info.md) | Describes the information about a font weight mapping.| 74| struct [OH_Drawing_FontAliasInfo](_o_h___drawing___font_alias_info.md) | Describes the information about a font alias.| 75| struct [OH_Drawing_FontGenericInfo](_o_h___drawing___font_generic_info.md) | Describes the information about generic fonts supported by the system.| 76| struct [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) | Describes the information about a system font configuration.| 77| struct [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Describes a font style.| 78| struct [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) | Describes a font feature.| 79| struct [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Describes a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts.| 80| struct [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Describes a two-dimensional coordinate point.| 81| struct [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) | Describes a three-dimensional coordinate point.| 82| struct [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | Describes the image information.| 83| struct [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) | Describes the style of a rectangle.| 84 85 86### Types 87 88| Name| Description| 89| -------- | -------- | 90| typedef struct [OH_Drawing_String](_o_h___drawing___string.md) [OH_Drawing_String](#oh_drawing_string) | Defines a struct for a string of characters encoded in UTF-16.| 91| typedef enum [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype) [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype) | Defines an enum for the system font types.| 92| typedef struct [OH_Drawing_Array](#oh_drawing_array) [OH_Drawing_Array](#oh_drawing_array) | Defines a struct for an array object, which is used to store multiple objects of the same type.| 93| typedef struct [OH_Drawing_FontArguments](#oh_drawing_fontarguments) [OH_Drawing_FontArguments](#oh_drawing_fontarguments) | Defines a struct for font arguments.| 94| typedef struct [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) | Defines the recording command tool, which is used to generate recording commands.| 95| typedef struct [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) | Defines the recording command class, which is used to store the set of recording commands.| 96| typedef enum [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_ErrorCode](#oh_drawing_errorcode) | Defines an enum for the error codes that may be generated by the module.| 97| typedef enum [OH_Drawing_PathOpMode](#oh_drawing_pathopmode) [OH_Drawing_PathOpMode](#oh_drawing_pathopmode) | Defines an enum for the operation modes available for a path.| 98| typedef enum [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags) [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags) | Defines an enum for the types of matrix information obtained during path measurement.| 99| typedef enum [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode) [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode) | Defines an enum for the operation modes available for a region.| 100| typedef struct [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) | Defines a struct for an image filter, which is used to operate all color bits that make up image pixels.| 101| typedef struct [OH_Drawing_Filter](#oh_drawing_filter) [OH_Drawing_Filter](#oh_drawing_filter) | Defines a struct for a filter, which consists of a color filter, mask filter, and image filter.| 102| typedef struct [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) [OH_Drawing_BitmapFormat](#oh_drawing_bitmapformat) | Defines a struct for the pixel format of a bitmap, including the color type and alpha type.| 103| typedef enum [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint) [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint) | Defines an enum for the constraint types of the source rectangle.| 104| typedef enum [OH_Drawing_PointMode](#oh_drawing_pointmode) [OH_Drawing_PointMode](#oh_drawing_pointmode) | Defines an enum for the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.| 105| typedef enum [OH_Drawing_VertexMode](#oh_drawing_vertexmode) [OH_Drawing_VertexMode](#oh_drawing_vertexmode) | Defines an enum for the modes of interpreting the geometry of a given vertex.| 106| typedef enum [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) | Defines an enum for the canvas clipping modes.| 107| typedef enum [OH_Drawing_FontEdging](#oh_drawing_fontedging) [OH_Drawing_FontEdging](#oh_drawing_fontedging) | Defines an enum for the font edging types.| 108| typedef enum [OH_Drawing_FontHinting](#oh_drawing_fonthinting) [OH_Drawing_FontHinting](#oh_drawing_fonthinting) | Defines an enum for the font hinting types.| 109| typedef struct [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) [OH_Drawing_Font_Metrics](#oh_drawing_font_metrics) | Defines a struct for the measurement information about a font.| 110| typedef struct [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md) [OH_Drawing_GpuContextOptions](#oh_drawing_gpucontextoptions) | Defines a struct for the options about the GPU context.| 111| typedef enum [OH_Drawing_BlurType](#oh_drawing_blurtype) [OH_Drawing_BlurType](#oh_drawing_blurtype) | Defines an enum for the blur types.| 112| typedef enum [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit) [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit) | Defines an enum for the matrix scaling modes.| 113| typedef enum [OH_Drawing_PathDirection](#oh_drawing_pathdirection) [OH_Drawing_PathDirection](#oh_drawing_pathdirection) | Defines an enum for the directions of a closed contour.| 114| typedef enum [OH_Drawing_PathFillType](#oh_drawing_pathfilltype) [OH_Drawing_PathFillType](#oh_drawing_pathfilltype) | Defines an enum for the fill types of a path.| 115| typedef enum [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode) [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode) | Defines an enum for the path adding modes.| 116| typedef enum [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) | Defines an enum for the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.| 117| typedef enum [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) | Defines an enum for the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.| 118| typedef enum [OH_Drawing_CornerPos](#oh_drawing_cornerpos) [OH_Drawing_CornerPos](#oh_drawing_cornerpos) | Defines an enum for the corner positions of a rounded rectangle.| 119| typedef enum [OH_Drawing_FilterMode](#oh_drawing_filtermode) [OH_Drawing_FilterMode](#oh_drawing_filtermode) | Defines an enum for the filter modes.| 120| typedef enum [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode) [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode) | Defines an enum for the mipmap modes.| 121| typedef enum [OH_Drawing_TileMode](#oh_drawing_tilemode) [OH_Drawing_TileMode](#oh_drawing_tilemode) | Defines an enum for the tile modes of the shader effect.| 122| typedef struct [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md) [OH_Drawing_RunBuffer](#oh_drawing_runbuffer) | Defines a struct for a run, which provides storage for glyphs and positions.| 123| typedef struct [OH_Drawing_FontCollection](#oh_drawing_fontcollection) [OH_Drawing_FontCollection](#oh_drawing_fontcollection) | Defines a struct used to load fonts.| 124| typedef struct [OH_Drawing_Typography](#oh_drawing_typography) [OH_Drawing_Typography](#oh_drawing_typography) | Defines a struct used to manage the typography layout and display.| 125| typedef struct [OH_Drawing_TextStyle](#oh_drawing_textstyle) [OH_Drawing_TextStyle](#oh_drawing_textstyle) | Defines a struct used to manage text colors and decorations.| 126| typedef struct [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) | Defines a struct used to manage the typography style, such as the text direction.| 127| typedef struct [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) | Defines a struct used to create an [OH_Drawing_Typography](#oh_drawing_typography) object.| 128| typedef struct [OH_Drawing_TextBox](#oh_drawing_textbox) [OH_Drawing_TextBox](#oh_drawing_textbox) | Defines a struct for a text box, which is used to receive the rectangle size, direction, and quantity.| 129| typedef struct [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) | Defines a struct used to receive the position and affinity of a glyph.| 130| typedef struct [OH_Drawing_Range](#oh_drawing_range) [OH_Drawing_Range](#oh_drawing_range) | Defines a struct for a range, which is used to receive the start position and end position of a glyph.| 131| typedef struct [OH_Drawing_TextShadow](#oh_drawing_textshadow) [OH_Drawing_TextShadow](#oh_drawing_textshadow) | Defines a struct used to manage text shadows.| 132| typedef struct [OH_Drawing_FontParser](#oh_drawing_fontparser) [OH_Drawing_FontParser](#oh_drawing_fontparser) | Defines a struct used to parse system font files.| 133| typedef enum [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment) [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment) | Defines an enum for the vertical alignment modes of placeholders.| 134| typedef struct [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) [OH_Drawing_PlaceholderSpan](#oh_drawing_placeholderspan) | Defines a struct for the placeholder that acts as a span.| 135| typedef enum [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle) [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle) | Defines an enum for the text decoration styles.| 136| typedef enum [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal) [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal) | Defines an enum for the text ellipsis styles.| 137| typedef enum [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy) [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy) | Defines an enum for the text break strategies.| 138| typedef enum [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype) [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype) | Defines an enum for the word break types.| 139| typedef enum [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle) [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle) | Defines an enum for the rectangle height styles.| 140| typedef enum [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle) [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle) | Defines an enum for the rectangle width styles.| 141| typedef struct [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) [OH_Drawing_FontDescriptor](#oh_drawing_fontdescriptor) | Defines a struct for the detailed information about a system font.| 142| typedef struct [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) [OH_Drawing_LineMetrics](#oh_drawing_linemetrics) | Defines a struct for the measurement information about a line of text.| 143| typedef struct [OH_Drawing_FontFallbackInfo](_o_h___drawing___font_fallback_info.md) [OH_Drawing_FontFallbackInfo](#oh_drawing_fontfallbackinfo) | Defines a struct for the information about a font fallback.| 144| typedef struct [OH_Drawing_FontFallbackGroup](_o_h___drawing___font_fallback_group.md) [OH_Drawing_FontFallbackGroup](#oh_drawing_fontfallbackgroup) | Defines a struct for the information about a font fallback group.| 145| typedef struct [OH_Drawing_FontAdjustInfo](_o_h___drawing___font_adjust_info.md) [OH_Drawing_FontAdjustInfo](#oh_drawing_fontadjustinfo) | Defines a struct for the information about a font weight mapping.| 146| typedef struct [OH_Drawing_FontAliasInfo](_o_h___drawing___font_alias_info.md) [OH_Drawing_FontAliasInfo](#oh_drawing_fontaliasinfo) | Defines a struct for the information about a font alias.| 147| typedef struct [OH_Drawing_FontGenericInfo](_o_h___drawing___font_generic_info.md) [OH_Drawing_FontGenericInfo](#oh_drawing_fontgenericinfo) | Defines a struct for the information about generic fonts supported by the system.| 148| typedef struct [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) [OH_Drawing_FontConfigInfo](#oh_drawing_fontconfiginfo) | Defines a struct for the information about a system font configuration.| 149| typedef struct [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_FontStyleStruct](#oh_drawing_fontstylestruct) | Defines a struct for a font style.| 150| typedef struct [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) [OH_Drawing_StrutStyle](#oh_drawing_strutstyle) | Defines a struct for a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts.| 151| typedef struct [OH_Drawing_Canvas](#oh_drawing_canvas) [OH_Drawing_Canvas](#oh_drawing_canvas) | Defines a struct for a rectangular canvas, on which various shapes, images, and texts can be drawn by using the brush and pen.| 152| typedef struct [OH_Drawing_Pen](#oh_drawing_pen) [OH_Drawing_Pen](#oh_drawing_pen) | Defines a struct for a pen, which is used to describe the style and color to outline a shape.| 153| typedef struct [OH_Drawing_Region](#oh_drawing_region) [OH_Drawing_Region](#oh_drawing_region) | Defines a struct for a region, which represents a closed area on the canvas for more accurate graphic control.| 154| typedef struct [OH_Drawing_Brush](#oh_drawing_brush) [OH_Drawing_Brush](#oh_drawing_brush) | Defines a struct for a brush, which is used to describe the style and color to fill in a shape.| 155| typedef struct [OH_Drawing_Path](#oh_drawing_path) [OH_Drawing_Path](#oh_drawing_path) | Defines a struct for a path, which is used to customize various shapes.| 156| typedef struct [OH_Drawing_PixelMap](#oh_drawing_pixelmap) [OH_Drawing_PixelMap](#oh_drawing_pixelmap) | Defines a struct for a pixel map, which is used to wrap the real pixel map supported by the image framework.| 157| typedef struct [OH_Drawing_Bitmap](#oh_drawing_bitmap) [OH_Drawing_Bitmap](#oh_drawing_bitmap) | Defines a struct for a bitmap, which is a memory area that contains the pixel data of a shape.| 158| typedef struct [OH_Drawing_Point](#oh_drawing_point) [OH_Drawing_Point](#oh_drawing_point) | Defines a struct for a coordinate point.| 159| typedef struct [OH_Drawing_ColorSpace](#oh_drawing_colorspace) [OH_Drawing_ColorSpace](#oh_drawing_colorspace) | Defines a struct for a color space, which is used to describe the color information.| 160| typedef struct [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) [OH_Drawing_Point2D](#oh_drawing_point2d) | Defines a struct for a two-dimensional coordinate point.| 161| typedef [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) | Defines a struct for the radii of a rounded corner. The radii consist of the radius in the x-axis direction and that in the y-axis direction.| 162| typedef struct [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) [OH_Drawing_Point3D](#oh_drawing_point3d) | Defines a struct for a three-dimensional coordinate point.| 163| typedef struct [OH_Drawing_PathEffect](#oh_drawing_patheffect) [OH_Drawing_PathEffect](#oh_drawing_patheffect) | Defines a struct for a path effect that affects the stroke.| 164| typedef struct [OH_Drawing_Rect](#oh_drawing_rect) [OH_Drawing_Rect](#oh_drawing_rect) | Defines a struct for a rectangle.| 165| typedef struct [OH_Drawing_RoundRect](#oh_drawing_roundrect) [OH_Drawing_RoundRect](#oh_drawing_roundrect) | Defines a struct for a rounded rectangle.| 166| typedef struct [OH_Drawing_Matrix](#oh_drawing_matrix) [OH_Drawing_Matrix](#oh_drawing_matrix) | Defines a struct for a matrix, which is used to describe coordinate transformation.| 167| typedef struct [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) | Defines a struct for a shader effect, which is used to describe the source color of the drawn content.| 168| typedef struct [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) | Defines a struct for a shadow, which is used to describe the shadow layer of the drawn content.| 169| typedef struct [OH_Drawing_Filter](#oh_drawing_filter) [OH_Drawing_Filter](#oh_drawing_filter) | Defines a struct for a filter, which consists of a color filter and mask filter.| 170| typedef struct [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) | Defines a struct for a mask filter, which is used to convert a mask into a new one.| 171| typedef struct [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) | Defines a struct for a color filter, which is used to convert a color into a new one.| 172| typedef struct [OH_Drawing_Font](#oh_drawing_font) [OH_Drawing_Font](#oh_drawing_font) | Defines a struct for a font.| 173| typedef struct [OH_Drawing_MemoryStream](#oh_drawing_memorystream) [OH_Drawing_MemoryStream](#oh_drawing_memorystream) | Defines a struct for a memory stream.| 174| typedef struct [OH_Drawing_Typeface](#oh_drawing_typeface) [OH_Drawing_Typeface](#oh_drawing_typeface) | Defines a struct for a typeface.| 175| typedef struct [OH_Drawing_TextBlob](#oh_drawing_textblob) [OH_Drawing_TextBlob](#oh_drawing_textblob) | Defines a struct for a text blob, an immutable container that holds multiple texts. Each text blob consists of glyphs and position.| 176| typedef struct [OH_Drawing_Image](#oh_drawing_image) [OH_Drawing_Image](#oh_drawing_image) | Defines a struct for an image that describes a two-dimensional pixel array.| 177| typedef struct [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) | Defines a struct for sampling options, which describe the sampling methods for images and bitmaps.| 178| typedef struct [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) | Defines a struct for a text blob builder, which is used to build a text blob.| 179| typedef struct [OH_Drawing_GpuContext](#oh_drawing_gpucontext) [OH_Drawing_GpuContext](#oh_drawing_gpucontext) | Defines a struct for the GPU context, which is used to describe the GPU backend context.| 180| typedef struct [OH_Drawing_Surface](#oh_drawing_surface) [OH_Drawing_Surface](#oh_drawing_surface) | Defines a struct for a surface, which is used to manage the content drawn on the canvas.| 181| typedef enum [OH_Drawing_ColorFormat](#oh_drawing_colorformat) [OH_Drawing_ColorFormat](#oh_drawing_colorformat) | Defines an enum for the storage formats of bitmap pixels.| 182| typedef enum [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) | Defines an enum for the alpha formats of bitmap pixels.| 183| typedef enum [OH_Drawing_BlendMode](#oh_drawing_blendmode) [OH_Drawing_BlendMode](#oh_drawing_blendmode) | Defines an enum for the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same on the four channels (red, green, blue, and alpha). The operations for the alpha channel are used as examples.| 184| typedef struct [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) [OH_Drawing_Image_Info](#oh_drawing_image_info) | Defines a struct for the image information.| 185| typedef struct [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) [OH_Drawing_RectStyle_Info](#oh_drawing_rectstyle_info) | Defines a struct for the style of a rectangle.| 186| typedef enum [OH_Drawing_TextEncoding](#oh_drawing_textencoding) [OH_Drawing_TextEncoding](#oh_drawing_textencoding) | Defines an enum for the text encoding types.| 187| typedef struct [OH_Drawing_FontMgr](#oh_drawing_fontmgr) [OH_Drawing_FontMgr](#oh_drawing_fontmgr) | Defines a struct for the font manager, which is used for font management.| 188| typedef struct [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) | Defines a struct for a font style set, which is used for font style family matching.| 189| typedef enum [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) | Defines an enum for the shadow flags.| 190 191### Enums 192 193| Name| Description| 194| -------- | -------- | 195| [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype-1) { ALL = 1 << 0, GENERIC = 1 << 1, STYLISH = 1 << 2, INSTALLED = 1 << 3 } | Enumerates the system font types.| 196| [OH_Drawing_ErrorCode](#oh_drawing_errorcode-1) { OH_DRAWING_SUCCESS = 0, OH_DRAWING_ERROR_NO_PERMISSION = 201, OH_DRAWING_ERROR_INVALID_PARAMETER = 401, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001,OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002 } | Enumerates the error codes that may be generated by the module.| 197| [OH_Drawing_PathOpMode](#oh_drawing_pathopmode-1) {<br>PATH_OP_MODE_DIFFERENCE, PATH_OP_MODE_INTERSECT, PATH_OP_MODE_UNION, PATH_OP_MODE_XOR,<br>PATH_OP_MODE_REVERSE_DIFFERENCE<br>} | Enumerates the operation modes available for a path.| 198| [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags-1) { GET_POSITION_MATRIX, GET_TANGENT_MATRIX, GET_POSITION_AND_TANGENT_MATRIX } | Enumerates the types of matrix information obtained during path measurement.| 199| [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode-1) {<br>REGION_OP_MODE_DIFFERENCE, REGION_OP_MODE_INTERSECT, REGION_OP_MODE_UNION, REGION_OP_MODE_XOR,<br>REGION_OP_MODE_REVERSE_DIFFERENCE, REGION_OP_MODE_REPLACE<br>} | Enumerates the operation modes available for a region.| 200| [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint-1) { STRICT_SRC_RECT_CONSTRAINT, FAST_SRC_RECT_CONSTRAINT } | Enumerates the constraint types of the source rectangle.| 201| [OH_Drawing_PointMode](#oh_drawing_pointmode-1) { POINT_MODE_POINTS, POINT_MODE_LINES, POINT_MODE_POLYGON } | Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.| 202| [OH_Drawing_VertexMode](#oh_drawing_vertexmode-1) { VERTEX_MODE_TRIANGLES, VERTEX_MODE_TRIANGLESSTRIP, VERTEX_MODE_TRIANGLEFAN } | Enumerates the modes of interpreting the geometry of a given vertex.| 203| [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop-1) { DIFFERENCE, INTERSECT } | Enumerates the canvas clipping modes.| 204| [OH_Drawing_FontEdging](#oh_drawing_fontedging-1) { FONT_EDGING_ALIAS, FONT_EDGING_ANTI_ALIAS, FONT_EDGING_SUBPIXEL_ANTI_ALIAS } | Enumerates the font edging types.| 205| [OH_Drawing_FontHinting](#oh_drawing_fonthinting-1) { FONT_HINTING_NONE, FONT_HINTING_SLIGHT, FONT_HINTING_NORMAL, FONT_HINTING_FULL } | Enumerates the font hinting types.| 206| [OH_Drawing_BlurType](#oh_drawing_blurtype-1) { NORMAL, SOLID, OUTER, INNER } | Enumerates the blur types.| 207| [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit-1) { SCALE_TO_FIT_FILL, SCALE_TO_FIT_START, SCALE_TO_FIT_CENTER, SCALE_TO_FIT_END } | Enumerates the matrix scaling modes.| 208| [OH_Drawing_PathDirection](#oh_drawing_pathdirection-1) { PATH_DIRECTION_CW, PATH_DIRECTION_CCW } | Enumerates the directions of a closed contour.| 209| [OH_Drawing_PathFillType](#oh_drawing_pathfilltype-1) { PATH_FILL_TYPE_WINDING, PATH_FILL_TYPE_EVEN_ODD, PATH_FILL_TYPE_INVERSE_WINDING, PATH_FILL_TYPE_INVERSE_EVEN_ODD } | Enumerates the fill types of a path.| 210| [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode-1) { PATH_ADD_MODE_APPEND, PATH_ADD_MODE_EXTEND } | Enumerates the path adding modes.| 211| [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle-1) { LINE_FLAT_CAP, LINE_SQUARE_CAP, LINE_ROUND_CAP } | Enumerates the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.| 212| [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle-1) { LINE_MITER_JOIN, LINE_ROUND_JOIN, LINE_BEVEL_JOIN } | Enumerates the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.| 213| [OH_Drawing_CornerPos](#oh_drawing_cornerpos-1) { CORNER_POS_TOP_LEFT, CORNER_POS_TOP_RIGHT, CORNER_POS_BOTTOM_RIGHT, CORNER_POS_BOTTOM_LEFT } | Enumerates the corner positions of a rounded rectangle.| 214| [OH_Drawing_FilterMode](#oh_drawing_filtermode-1) { FILTER_MODE_NEAREST, FILTER_MODE_LINEAR } | Enumerates the filter modes.| 215| [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode-1) { MIPMAP_MODE_NONE, MIPMAP_MODE_NEAREST, MIPMAP_MODE_LINEAR } | Enumerates the mipmap modes.| 216| [OH_Drawing_TileMode](#oh_drawing_tilemode-1) { CLAMP, REPEAT, MIRROR, DECAL } | Enumerates the tile modes of the shader effect.| 217| [OH_Drawing_TextDirection](#oh_drawing_textdirection) { TEXT_DIRECTION_RTL, TEXT_DIRECTION_LTR } | Enumerates the text directions.| 218| [OH_Drawing_TextAlign](#oh_drawing_textalign) {<br>TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_JUSTIFY,<br>TEXT_ALIGN_START, TEXT_ALIGN_END<br>} | Enumerates the text alignment modes.| 219| [OH_Drawing_FontWeight](#oh_drawing_fontweight) {<br>FONT_WEIGHT_100, FONT_WEIGHT_200, FONT_WEIGHT_300, FONT_WEIGHT_400,<br>FONT_WEIGHT_500, FONT_WEIGHT_600, FONT_WEIGHT_700, FONT_WEIGHT_800,<br>FONT_WEIGHT_900<br>} | Enumerates the font weights.| 220| [OH_Drawing_TextBaseline](#oh_drawing_textbaseline) { TEXT_BASELINE_ALPHABETIC, TEXT_BASELINE_IDEOGRAPHIC } | Enumerates the text baselines.| 221| [OH_Drawing_TextDecoration](#oh_drawing_textdecoration) { TEXT_DECORATION_NONE = 0x0, TEXT_DECORATION_UNDERLINE = 0x1, TEXT_DECORATION_OVERLINE = 0x2, TEXT_DECORATION_LINE_THROUGH = 0x4 } | Enumerates the text decorations.| 222| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) { FONT_STYLE_NORMAL, FONT_STYLE_ITALIC, FONT_STYLE_OBLIQUE } | Enumerates the font styles.| 223| [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment-1) {<br>ALIGNMENT_OFFSET_AT_BASELINE, ALIGNMENT_ABOVE_BASELINE, ALIGNMENT_BELOW_BASELINE, ALIGNMENT_TOP_OF_ROW_BOX,<br>ALIGNMENT_BOTTOM_OF_ROW_BOX, ALIGNMENT_CENTER_OF_ROW_BOX<br>} | Enumerates the vertical alignment modes of placeholders.| 224| [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle-1) {<br>TEXT_DECORATION_STYLE_SOLID, TEXT_DECORATION_STYLE_DOUBLE, TEXT_DECORATION_STYLE_DOTTED, TEXT_DECORATION_STYLE_DASHED,<br>TEXT_DECORATION_STYLE_WAVY<br>} | Enumerates the text decoration styles.| 225| [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal-1) { ELLIPSIS_MODAL_HEAD = 0, ELLIPSIS_MODAL_MIDDLE = 1, ELLIPSIS_MODAL_TAIL = 2 } | Enumerates the text ellipsis styles.| 226| [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy-1) { BREAK_STRATEGY_GREEDY = 0, BREAK_STRATEGY_HIGH_QUALITY = 1, BREAK_STRATEGY_BALANCED = 2 } | Enumerates the text break strategies.| 227| [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype-1) { WORD_BREAK_TYPE_NORMAL = 0, WORD_BREAK_TYPE_BREAK_ALL = 1, WORD_BREAK_TYPE_BREAK_WORD = 2 } | Enumerates the word break types.| 228| [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle-1) {<br>RECT_HEIGHT_STYLE_TIGHT, RECT_HEIGHT_STYLE_MAX, RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE, RECT_HEIGHT_STYLE_INCLUDELINESPACETOP,<br>RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM, RECT_HEIGHT_STYLE_STRUCT<br>} | Enumerates the rectangle height styles.| 229| [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle-1) { RECT_WIDTH_STYLE_TIGHT, RECT_WIDTH_STYLE_MAX } | Enumerates the rectangle width styles.| 230| [OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode) {<br>SUCCESS_FONT_CONFIG_INFO = 0, ERROR_FONT_CONFIG_INFO_UNKNOWN = 1, ERROR_FONT_CONFIG_INFO_PARSE_FILE = 2, ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY = 3,<br>ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA = 4<br>} | Enumerates the error codes that may be used during the obtaining of system font configurations.| 231| [OH_Drawing_FontWidth](#oh_drawing_fontwidth) {<br>ULTRA_CONDENSED_WIDTH = 1, EXTRA_CONDENSED_WIDTH = 2, CONDENSED_WIDTH = 3, SEMI_CONDENSED_WIDTH = 4,<br>NORMAL_WIDTH = 5, SEMI_EXPANDED_WIDTH = 6, EXPANDED_WIDTH = 7, EXTRA_EXPANDED_WIDTH = 8,<br>ULTRA_EXPANDED_WIDTH = 9<br>} | Enumerates the font widths.| 232| [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) { TEXT_HEIGHT_ALL = 0x0, TEXT_HEIGHT_DISABLE_FIRST_ASCENT = 0x1, TEXT_HEIGHT_DISABLE_LAST_ASCENT = 0x2, TEXT_HEIGHT_DISABLE_ALL = 0x1 \| 0x2 } | Enumerates the text height modifier patterns.| 233| [OH_Drawing_TextStyleType](#oh_drawing_textstyletype) {<br>TEXT_STYLE_NONE, TEXT_STYLE_ALL_ATTRIBUTES, TEXT_STYLE_FONT, TEXT_STYLE_FOREGROUND,<br>TEXT_STYLE_BACKGROUND, TEXT_STYLE_SHADOW, TEXT_STYLE_DECORATIONS, TEXT_STYLE_LETTER_SPACING,<br>TEXT_STYLE_WORD_SPACING<br>} | Enumerates the text style types.| 234| [OH_Drawing_ColorFormat](#oh_drawing_colorformat-1) {<br>COLOR_FORMAT_UNKNOWN, COLOR_FORMAT_ALPHA_8, COLOR_FORMAT_RGB_565, COLOR_FORMAT_ARGB_4444,<br>COLOR_FORMAT_RGBA_8888, COLOR_FORMAT_BGRA_8888<br>} | Enumerates the storage formats of bitmap pixels.| 235| [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat-1) { ALPHA_FORMAT_UNKNOWN, ALPHA_FORMAT_OPAQUE, ALPHA_FORMAT_PREMUL, ALPHA_FORMAT_UNPREMUL } | Enumerates the alpha formats of bitmap pixels.| 236| [OH_Drawing_BlendMode](#oh_drawing_blendmode-1) {<br>BLEND_MODE_CLEAR, BLEND_MODE_SRC, BLEND_MODE_DST, BLEND_MODE_SRC_OVER,<br>BLEND_MODE_DST_OVER, BLEND_MODE_SRC_IN, BLEND_MODE_DST_IN, BLEND_MODE_SRC_OUT,<br>BLEND_MODE_DST_OUT, BLEND_MODE_SRC_ATOP, BLEND_MODE_DST_ATOP, BLEND_MODE_XOR,<br>BLEND_MODE_PLUS, BLEND_MODE_MODULATE, BLEND_MODE_SCREEN, BLEND_MODE_OVERLAY,<br>BLEND_MODE_DARKEN, BLEND_MODE_LIGHTEN, BLEND_MODE_COLOR_DODGE, BLEND_MODE_COLOR_BURN,<br>BLEND_MODE_HARD_LIGHT, BLEND_MODE_SOFT_LIGHT, BLEND_MODE_DIFFERENCE, BLEND_MODE_EXCLUSION,<br>BLEND_MODE_MULTIPLY, BLEND_MODE_HUE, BLEND_MODE_SATURATION, BLEND_MODE_COLOR,<br>BLEND_MODE_LUMINOSITY<br>} | Enumerates the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same on the four channels (red, green, blue, and alpha). The operations for the alpha channel are used as examples.| 237| [OH_Drawing_TextEncoding](#oh_drawing_textencoding-1) { TEXT_ENCODING_UTF8, TEXT_ENCODING_UTF16, TEXT_ENCODING_UTF32, TEXT_ENCODING_GLYPH_ID } | Enumerates the text encoding types.| 238| [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags-1) { SHADOW_FLAGS_NONE, SHADOW_FLAGS_TRANSPARENT_OCCLUDER, SHADOW_FLAGS_GEOMETRIC_ONLY, SHADOW_FLAGS_ALL } | Enumerates the shadow flags.| 239 240### Functions 241 242| Name| Description| 243| -------- | -------- | 244| OH_Drawing_FontCollection \* [OH_Drawing_GetFontCollectionGlobalInstance](#oh_drawing_getfontcollectionglobalinstance) (void) | Obtains the global **OH_Drawing_FontCollection** object, which can be used to sense the theme font information. Do not release the object. | 245| [OH_Drawing_Bitmap](#oh_drawing_bitmap) \* [OH_Drawing_BitmapCreate](#oh_drawing_bitmapcreate) (void) | Creates an **OH_Drawing_Bitmap** object.| 246| void [OH_Drawing_BitmapDestroy](#oh_drawing_bitmapdestroy) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Destroys an **OH_Drawing_Bitmap** object and reclaims the memory occupied by the object.| 247| [OH_Drawing_Bitmap](#oh_drawing_bitmap) \* [OH_Drawing_BitmapCreateFromPixels](#oh_drawing_bitmapcreatefrompixels) ([OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*, void \*pixels, uint32_t rowBytes) | Creates an **OH_Drawing_Bitmap** object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for.| 248| void [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) \*) | Initializes the width and height of a bitmap and sets the pixel format for the bitmap.| 249| uint32_t [OH_Drawing_BitmapGetWidth](#oh_drawing_bitmapgetwidth) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the width of a bitmap.| 250| uint32_t [OH_Drawing_BitmapGetHeight](#oh_drawing_bitmapgetheight) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the height of a bitmap.| 251| [OH_Drawing_ColorFormat](#oh_drawing_colorformat) [OH_Drawing_BitmapGetColorFormat](#oh_drawing_bitmapgetcolorformat) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the pixel format of a bitmap.| 252| [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) [OH_Drawing_BitmapGetAlphaFormat](#oh_drawing_bitmapgetalphaformat) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the alpha component of a bitmap.| 253| void \* [OH_Drawing_BitmapGetPixels](#oh_drawing_bitmapgetpixels) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.| 254| void [OH_Drawing_BitmapGetImageInfo](#oh_drawing_bitmapgetimageinfo) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*) | Obtains the image information of a bitmap.| 255| bool [OH_Drawing_BitmapReadPixels](#oh_drawing_bitmapreadpixels) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*dstInfo, void \*dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY) | Reads pixels of a rectangle in a bitmap to the specified buffer.| 256| [OH_Drawing_Brush](#oh_drawing_brush) \* [OH_Drawing_BrushCreate](#oh_drawing_brushcreate) (void) | Creates an **OH_Drawing_Brush** object.| 257| [OH_Drawing_Brush](#oh_drawing_brush) \* [OH_Drawing_BrushCopy](#oh_drawing_brushcopy) ([OH_Drawing_Brush](#oh_drawing_brush) \*brush) | Copies an existing [OH_Drawing_Brush](#oh_drawing_brush) object to create a new one.| 258| void [OH_Drawing_BrushDestroy](#oh_drawing_brushdestroy) ([OH_Drawing_Brush](#oh_drawing_brush) \*) | Destroys an **OH_Drawing_Brush** object and reclaims the memory occupied by the object.| 259| bool [OH_Drawing_BrushIsAntiAlias](#oh_drawing_brushisantialias) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.| 260| void [OH_Drawing_BrushSetAntiAlias](#oh_drawing_brushsetantialias) ([OH_Drawing_Brush](#oh_drawing_brush) \*, bool) | Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.| 261| uint32_t [OH_Drawing_BrushGetColor](#oh_drawing_brushgetcolor) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the color of a brush. The color is used by the brush to fill in a shape.| 262| void [OH_Drawing_BrushSetColor](#oh_drawing_brushsetcolor) ([OH_Drawing_Brush](#oh_drawing_brush) \*, uint32_t color) | Sets the color for a brush. The color is used by the brush to fill in a shape.| 263| uint8_t [OH_Drawing_BrushGetAlpha](#oh_drawing_brushgetalpha) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape.| 264| void [OH_Drawing_BrushSetAlpha](#oh_drawing_brushsetalpha) ([OH_Drawing_Brush](#oh_drawing_brush) \*, uint8_t alpha) | Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape.| 265| void [OH_Drawing_BrushSetShaderEffect](#oh_drawing_brushsetshadereffect) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Sets the shader effect for a brush.| 266| void [OH_Drawing_BrushSetShadowLayer](#oh_drawing_brushsetshadowlayer) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn.| 267| void [OH_Drawing_BrushSetFilter](#oh_drawing_brushsetfilter) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Sets a filter for a brush. The filter is a container that holds a mask filter and color filter.| 268| void [OH_Drawing_BrushGetFilter](#oh_drawing_brushgetfilter) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Obtains the filter of a brush. The filter is a container that holds a mask filter and color filter.| 269| void [OH_Drawing_BrushSetBlendMode](#oh_drawing_brushsetblendmode) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Sets a blender for a brush. The blender implements the specified blend mode.| 270| void [OH_Drawing_BrushReset](#oh_drawing_brushreset) ([OH_Drawing_Brush](#oh_drawing_brush) \*) | Resets a brush to the initial state. All configured attributes are cleared.| 271| [OH_Drawing_Canvas](#oh_drawing_canvas) \* [OH_Drawing_CanvasCreate](#oh_drawing_canvascreate) (void) | Creates an **OH_Drawing_Canvas** object.| 272| void [OH_Drawing_CanvasDestroy](#oh_drawing_canvasdestroy) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object.| 273| void [OH_Drawing_CanvasBind](#oh_drawing_canvasbind) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is called CPU rendering.)| 274| void [OH_Drawing_CanvasAttachPen](#oh_drawing_canvasattachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape.| 275| void [OH_Drawing_CanvasDetachPen](#oh_drawing_canvasdetachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline a shape.| 276| void [OH_Drawing_CanvasAttachBrush](#oh_drawing_canvasattachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape.| 277| void [OH_Drawing_CanvasDetachBrush](#oh_drawing_canvasdetachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a shape.| 278| void [OH_Drawing_CanvasSave](#oh_drawing_canvassave) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Saves the current canvas status (canvas matrix) to the top of the stack.| 279| void [OH_Drawing_CanvasSaveLayer](#oh_drawing_canvassavelayer) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore), the changes made to the matrix and clipping region are discarded, and the bitmap is drawn.| 280| void [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Restores the canvas status (canvas matrix) saved on the top of the stack.| 281| uint32_t [OH_Drawing_CanvasGetSaveCount](#oh_drawing_canvasgetsavecount) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the number of canvas statuses (canvas matrices) saved in the stack.| 282| void [OH_Drawing_CanvasRestoreToCount](#oh_drawing_canvasrestoretocount) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, uint32_t saveCount) | Restores to a given number of canvas statuses (canvas matrices).| 283| void [OH_Drawing_CanvasDrawLine](#oh_drawing_canvasdrawline) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float x1, float y1, float x2, float y2) | Draws a line segment.| 284| void [OH_Drawing_CanvasDrawPath](#oh_drawing_canvasdrawpath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Path](#oh_drawing_path) \*) | Draws a path.| 285| void [OH_Drawing_CanvasDrawPixelMapRect](#oh_drawing_canvasdrawpixelmaprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws a portion of a pixel map onto a specified area of the canvas.| 286| void [OH_Drawing_CanvasDrawBackground](#oh_drawing_canvasdrawbackground) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Draws a background filled with a brush.| 287| void [OH_Drawing_CanvasDrawRegion](#oh_drawing_canvasdrawregion) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Region](#oh_drawing_region) \*) | Draws a region.| 288| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawPoint](#oh_drawing_canvasdrawpoint) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*point) | Draws a point.| 289| void [OH_Drawing_CanvasDrawPoints](#oh_drawing_canvasdrawpoints) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_PointMode](#oh_drawing_pointmode) mode, uint32_t count, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*) | Draws multiple points. You can draw a single point, a line segment, or an open polygon.| 290| void [OH_Drawing_CanvasDrawBitmap](#oh_drawing_canvasdrawbitmap) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, float left, float top) | Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, includes single points called pixels (image elements).| 291| void [OH_Drawing_CanvasDrawBitmapRect](#oh_drawing_canvasdrawbitmaprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws a portion of a bitmap onto a specified area of the canvas.| 292| void [OH_Drawing_CanvasSetMatrix](#oh_drawing_canvassetmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Sets the matrix status for a canvas.| 293| void [OH_Drawing_CanvasResetMatrix](#oh_drawing_canvasresetmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Resets the matrix of a canvas to an identity matrix.| 294| void [OH_Drawing_CanvasDrawImageRectWithSrc](#oh_drawing_canvasdrawimagerectwithsrc) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Image](#oh_drawing_image) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*, [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint)) | Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is scaled and translated to the destination rectangle.| 295| void [OH_Drawing_CanvasDrawImageRect](#oh_drawing_canvasdrawimagerect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*dst, [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws an image onto a specified area of the canvas.| 296| void [OH_Drawing_CanvasDrawVertices](#oh_drawing_canvasdrawvertices) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_VertexMode](#oh_drawing_vertexmode) vertexMmode, int32_t vertexCount, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*positions, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*texs, const uint32_t \*colors, int32_t indexCount, const uint16_t \*indices, [OH_Drawing_BlendMode](#oh_drawing_blendmode) mode) | Draws a triangular grid described by a vertex array.| 297| bool [OH_Drawing_CanvasReadPixels](#oh_drawing_canvasreadpixels) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*, void \*dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY) | Copies pixel data from a canvas to a specified address. This function cannot be used for recorded canvases.| 298| bool [OH_Drawing_CanvasReadPixelsToBitmap](#oh_drawing_canvasreadpixelstobitmap) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, int32_t srcX, int32_t srcY) | Copies pixel data from a canvas to an image. This function cannot be used for recorded canvases.| 299| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasIsClipEmpty](#oh_drawing_canvasisclipempty) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, bool \*isClipEmpty) | Checks whether the region that can be drawn is empty after cropping.| 300| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasGetImageInfo](#oh_drawing_canvasgetimageinfo) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*imageInfo) | Obtains the image information of a canvas.| 301| void [OH_Drawing_CanvasDrawRect](#oh_drawing_canvasdrawrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Draws a rectangle.| 302| void [OH_Drawing_CanvasDrawCircle](#oh_drawing_canvasdrawcircle) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Point](#oh_drawing_point) \*, float radius) | Draws a circle.| 303| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawColor](#oh_drawing_canvasdrawcolor) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, uint32_t color, [OH_Drawing_BlendMode](#oh_drawing_blendmode) blendMode) | Fills the entire canvas with the specified color and blend mode.| 304| void [OH_Drawing_CanvasDrawOval](#oh_drawing_canvasdrawoval) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Draws an oval.| 305| void [OH_Drawing_CanvasDrawArc](#oh_drawing_canvasdrawarc) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, float startAngle, float sweepAngle) | Draws an arc.| 306| void [OH_Drawing_CanvasDrawRoundRect](#oh_drawing_canvasdrawroundrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*) | Draws a rounded rectangle.| 307| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawSingleCharacter](#oh_drawing_canvasdrawsinglecharacter) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const char \*str, const [OH_Drawing_Font](#oh_drawing_font) \*font, float x, float y) | Draws a single character. If the typeface of the current font does not support the character to draw, the system typeface is used to draw the character.| 308| void [OH_Drawing_CanvasDrawTextBlob](#oh_drawing_canvasdrawtextblob) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_TextBlob](#oh_drawing_textblob) \*, float x, float y) | Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, that character will not be drawn.| 309| uint32_t [OH_Drawing_ColorSetArgb](#oh_drawing_colorsetargb) (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue) | Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color.| 310| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateBlendMode](#oh_drawing_colorfiltercreateblendmode) (uint32_t color, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Creates an **OH_Drawing_ColorFilter** object with a given blend mode.| 311| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateCompose](#oh_drawing_colorfiltercreatecompose) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter1, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter2) | Creates an **OH_Drawing_ColorFilter** object by combining another two color filters.| 312| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateMatrix](#oh_drawing_colorfiltercreatematrix) (const float matrix[20]) | Creates an **OH_Drawing_ColorFilter** object with a given 5x4 color matrix.| 313| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateLinearToSrgbGamma](#oh_drawing_colorfiltercreatelineartosrgbgamma) (void) | Creates an **OH_Drawing_ColorFilter** object that applies the sRGB gamma curve to the RGB channels.| 314| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateSrgbGammaToLinear](#oh_drawing_colorfiltercreatesrgbgammatolinear) (void) | Creates an **OH_Drawing_ColorFilter** object that applies the RGB channels to the sRGB gamma curve.| 315| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateLuma](#oh_drawing_colorfiltercreateluma) (void) | Creates an **OH_Drawing_ColorFilter** object that multiplies the passed-in luma into the alpha channel and sets the RGB channels to zero.| 316| void [OH_Drawing_ColorFilterDestroy](#oh_drawing_colorfilterdestroy) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Destroys an **OH_Drawing_ColorFilter** object and reclaims the memory occupied by the object.| 317| [OH_Drawing_ColorSpace](#oh_drawing_colorspace) \* [OH_Drawing_ColorSpaceCreateSrgb](#oh_drawing_colorspacecreatesrgb) (void) | Creates an sRGB color space.| 318| [OH_Drawing_ColorSpace](#oh_drawing_colorspace) \* [OH_Drawing_ColorSpaceCreateSrgbLinear](#oh_drawing_colorspacecreatesrgblinear) (void) | Creates an sRGB linear (Gamma 1.0) color space.| 319| void [OH_Drawing_ColorSpaceDestroy](#oh_drawing_colorspacedestroy) ([OH_Drawing_ColorSpace](#oh_drawing_colorspace) \*) | Destroys an **OH_Drawing_ColorSpace** object and reclaims the memory occupied by the object.| 320| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget) () | Obtains the error code of the module.| 321| [OH_Drawing_Filter](#oh_drawing_filter) \* [OH_Drawing_FilterCreate](#oh_drawing_filtercreate) (void) | Creates an **OH_Drawing_Filter** object.| 322| void [OH_Drawing_FilterSetImageFilter](#oh_drawing_filtersetimagefilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*) | Sets an **OH_Drawing_ImageFilter** object for an **OH_Drawing_Filter** object.| 323| void [OH_Drawing_FilterSetMaskFilter](#oh_drawing_filtersetmaskfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \*) | Sets an **OH_Drawing_MaskFilter** object for an **OH_Drawing_Filter** object.| 324| void [OH_Drawing_FilterSetColorFilter](#oh_drawing_filtersetcolorfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Sets an **OH_Drawing_ColorFilter** object for an **OH_Drawing_Filter** object.| 325| void [OH_Drawing_FilterGetColorFilter](#oh_drawing_filtergetcolorfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Obtains an **OH_Drawing_ColorFilter** object from an **OH_Drawing_Filter** object.| 326| void [OH_Drawing_FilterDestroy](#oh_drawing_filterdestroy) ([OH_Drawing_Filter](#oh_drawing_filter) \*) | Destroys an **OH_Drawing_Filter** object and reclaims the memory occupied by the object.| 327| void [OH_Drawing_FontSetBaselineSnap](#oh_drawing_fontsetbaselinesnap) ([OH_Drawing_Font](#oh_drawing_font) \*, bool baselineSnap) | Sets whether to request that baselines be snapped to pixels when the current canvas matrix is axis aligned.| 328| bool [OH_Drawing_FontIsBaselineSnap](#oh_drawing_fontisbaselinesnap) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether baselines are requested to be snapped to pixels when the current canvas matrix is axis aligned.| 329| void [OH_Drawing_FontSetEdging](#oh_drawing_fontsetedging) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_FontEdging](#oh_drawing_fontedging)) | Sets a font edging effect.| 330| [OH_Drawing_FontEdging](#oh_drawing_fontedging) [OH_Drawing_FontGetEdging](#oh_drawing_fontgetedging) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the font edging effect.| 331| void [OH_Drawing_FontSetForceAutoHinting](#oh_drawing_fontsetforceautohinting) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isForceAutoHinting) | Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs.| 332| bool [OH_Drawing_FontIsForceAutoHinting](#oh_drawing_fontisforceautohinting) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether auto hinting is forcibly used.| 333| void [OH_Drawing_FontSetSubpixel](#oh_drawing_fontsetsubpixel) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isSubpixel) | Sets whether to use sub-pixel rendering for a font.| 334| bool [OH_Drawing_FontIsSubpixel](#oh_drawing_fontissubpixel) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether sub-pixel rendering is used for a font.| 335| [OH_Drawing_Font](#oh_drawing_font) \* [OH_Drawing_FontCreate](#oh_drawing_fontcreate) (void) | Creates an **OH_Drawing_Font** object.| 336| void [OH_Drawing_FontSetTypeface](#oh_drawing_fontsettypeface) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_Typeface](#oh_drawing_typeface) \*) | Sets the typeface for a font.| 337| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontGetTypeface](#oh_drawing_fontgettypeface) ([OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the typeface of a font.| 338| void [OH_Drawing_FontSetTextSize](#oh_drawing_fontsettextsize) ([OH_Drawing_Font](#oh_drawing_font) \*, float textSize) | Sets the font size.| 339| float [OH_Drawing_FontGetTextSize](#oh_drawing_fontgettextsize) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the text size.| 340| int [OH_Drawing_FontCountText](#oh_drawing_fontcounttext) ([OH_Drawing_Font](#oh_drawing_font) \*, const void \*text, size_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding) | Obtains the number of glyphs represented by text.| 341| uint32_t [OH_Drawing_FontTextToGlyphs](#oh_drawing_fonttexttoglyphs) (const [OH_Drawing_Font](#oh_drawing_font) \*, const void \*text, uint32_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding, uint16_t \*glyphs, int maxGlyphCount) | Converts text into glyph indices.| 342| void [OH_Drawing_FontGetWidths](#oh_drawing_fontgetwidths) (const [OH_Drawing_Font](#oh_drawing_font) \*, const uint16_t \*glyphs, int count, float \*widths) | Obtains the width of each glyph in a string of text.| 343| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontMeasureSingleCharacter](#oh_drawing_fontmeasuresinglecharacter) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const char \*str, float \*textWidth) | Measures the width of a single character. If the typeface of the current font does not support the character to measure, the system typeface is used to measure the character width.| 344| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontMeasureText](#oh_drawing_fontmeasuretext) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const void \*text, size_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding, [OH_Drawing_Rect](#oh_drawing_rect) \*bounds, float \*textWidth) | Obtains the text width and bounding box.| 345| void [OH_Drawing_FontSetLinearText](#oh_drawing_fontsetlineartext) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isLinearText) | Sets linear scaling for a font.| 346| bool [OH_Drawing_FontIsLinearText](#oh_drawing_fontislineartext) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether linear scaling is used for a font.| 347| void [OH_Drawing_FontSetTextSkewX](#oh_drawing_fontsettextskewx) ([OH_Drawing_Font](#oh_drawing_font) \*, float skewX) | Sets a horizontal skew factor for a font.| 348| float [OH_Drawing_FontGetTextSkewX](#oh_drawing_fontgettextskewx) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the horizontal skew factor of a font.| 349| void [OH_Drawing_FontSetFakeBoldText](#oh_drawing_fontsetfakeboldtext) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isFakeBoldText) | Sets fake bold for a font by increasing the stroke width.| 350| bool [OH_Drawing_FontIsFakeBoldText](#oh_drawing_fontisfakeboldtext) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether fake bold is used for a font.| 351| void [OH_Drawing_FontSetScaleX](#oh_drawing_fontsetscalex) ([OH_Drawing_Font](#oh_drawing_font) \*, float scaleX) | Sets a horizontal scale factor for a font.| 352| float [OH_Drawing_FontGetScaleX](#oh_drawing_fontgetscalex) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the horizontal scale factor of a font.| 353| void [OH_Drawing_FontSetHinting](#oh_drawing_fontsethinting) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_FontHinting](#oh_drawing_fonthinting)) | Sets a font hinting effect.| 354| [OH_Drawing_FontHinting](#oh_drawing_fonthinting) [OH_Drawing_FontGetHinting](#oh_drawing_fontgethinting) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the font hinting effect.| 355| void [OH_Drawing_FontSetEmbeddedBitmaps](#oh_drawing_fontsetembeddedbitmaps) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isEmbeddedBitmaps) | Sets whether to use bitmaps in a font.| 356| bool [OH_Drawing_FontIsEmbeddedBitmaps](#oh_drawing_fontisembeddedbitmaps) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether bitmaps are used in a font.| 357| void [OH_Drawing_FontDestroy](#oh_drawing_fontdestroy) ([OH_Drawing_Font](#oh_drawing_font) \*) | Destroys an **OH_Drawing_Font** object and reclaims the memory occupied by the object.| 358| float [OH_Drawing_FontGetMetrics](#oh_drawing_fontgetmetrics) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Obtains the measurement information about a font.| 359| [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \* [OH_Drawing_CreateFontCollection](#oh_drawing_createfontcollection) (void) | Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object.| 360| void [OH_Drawing_DestroyFontCollection](#oh_drawing_destroyfontcollection) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Destroys an **OH_Drawing_FontCollection** object and reclaims the memory occupied by the object.| 361| void [OH_Drawing_DisableFontCollectionFallback](#oh_drawing_disablefontcollectionfallback) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*fontCollection) | Disables the alternate fonts.| 362| void [OH_Drawing_DisableFontCollectionSystemFont](#oh_drawing_disablefontcollectionsystemfont) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*fontCollection) | Disables the system fonts.| 363| [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \* [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) (void) | Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object that is shareable.| 364| void [OH_Drawing_ClearFontCaches](#oh_drawing_clearfontcaches) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Clears the font cache. (The font cache has a memory limit and a clearing mechanism. It occupies limited memory. You are not advised to clear it unless otherwise required.)| 365| [OH_Drawing_FontMgr](#oh_drawing_fontmgr) \* [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate) (void) | Creates an **OH_Drawing_FontMgr** object.| 366| void [OH_Drawing_FontMgrDestroy](#oh_drawing_fontmgrdestroy) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*) | Destroys an **OH_Drawing_FontMgr** object and reclaims the memory occupied by the object.| 367| int [OH_Drawing_FontMgrGetFamilyCount](#oh_drawing_fontmgrgetfamilycount) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*) | Obtains the number of font families.| 368| char \* [OH_Drawing_FontMgrGetFamilyName](#oh_drawing_fontmgrgetfamilyname) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, int index) | Obtains the font family name based on an index.| 369| void [OH_Drawing_FontMgrDestroyFamilyName](#oh_drawing_fontmgrdestroyfamilyname) (char \*familyName) | Reclaims the memory occupied by a font family name.| 370| [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \* [OH_Drawing_FontMgrCreateFontStyleSet](#oh_drawing_fontmgrcreatefontstyleset) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, int index) | Creates a font style set from an **OH_Drawing_FontMgr** object.| 371| void [OH_Drawing_FontMgrDestroyFontStyleSet](#oh_drawing_fontmgrdestroyfontstyleset) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*) | Reclaims the memory occupied by a font style set.| 372| [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \* [OH_Drawing_FontMgrMatchFamily](#oh_drawing_fontmgrmatchfamily) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName) | Obtains a font style set based on a font family name.| 373| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontMgrMatchFamilyStyle](#oh_drawing_fontmgrmatchfamilystyle) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md)) | Obtains a typeface based on the font style information and font family name.| 374| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontMgrMatchFamilyStyleCharacter](#oh_drawing_fontmgrmatchfamilystylecharacter) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md), const char \*bcp47[], int bcp47Count, int32_t character) | Obtains a typeface for the specified character.| 375| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontStyleSetCreateTypeface](#oh_drawing_fontstylesetcreatetypeface) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, int index) | Creates a typeface for the specified index.| 376| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_FontStyleSetGetStyle](#oh_drawing_fontstylesetgetstyle) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, int32_t index, char \*\*styleName) | Obtains the font style.| 377| void [OH_Drawing_FontStyleSetFreeStyleName](#oh_drawing_fontstylesetfreestylename) (char \*\*styleName) | Reclaims the memory occupied by a font style.| 378| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontStyleSetMatchStyle](#oh_drawing_fontstylesetmatchstyle) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyleStruct) | Obtains the typeface closest to the font style.| 379| int [OH_Drawing_FontStyleSetCount](#oh_drawing_fontstylesetcount) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*) | Obtains the number of fonts in the font style set.| 380| [OH_Drawing_GpuContext](#oh_drawing_gpucontext) \* [OH_Drawing_GpuContextCreateFromGL](#oh_drawing_gpucontextcreatefromgl) ([OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md)) | Creates an **OH_Drawing_GpuContext** object that uses OpenGL as the backend interface.| 381| void [OH_Drawing_GpuContextDestroy](#oh_drawing_gpucontextdestroy) ([OH_Drawing_GpuContext](#oh_drawing_gpucontext) \*) | Destroys an **OH_Drawing_GpuContext** object and reclaims the memory occupied by the object.| 382| [OH_Drawing_Image](#oh_drawing_image) \* [OH_Drawing_ImageCreate](#oh_drawing_imagecreate) (void) | Creates an **OH_Drawing_Image** object that describes an array of two-dimensional pixels to draw.| 383| void [OH_Drawing_ImageDestroy](#oh_drawing_imagedestroy) ([OH_Drawing_Image](#oh_drawing_image) \*) | Destroys an **OH_Drawing_Image** object and reclaims the memory occupied by the object.| 384| bool [OH_Drawing_ImageBuildFromBitmap](#oh_drawing_imagebuildfrombitmap) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Builds an image from a bitmap by sharing or copying bitmap pixels. If the bitmap is marked as immutable, the pixel memory is shared, not copied.| 385| int32_t [OH_Drawing_ImageGetWidth](#oh_drawing_imagegetwidth) ([OH_Drawing_Image](#oh_drawing_image) \*) | Obtains the image width, that is, the number of pixels in each line.| 386| int32_t [OH_Drawing_ImageGetHeight](#oh_drawing_imagegetheight) ([OH_Drawing_Image](#oh_drawing_image) \*) | Obtains the image height, that is, the number of pixel lines.| 387| void [OH_Drawing_ImageGetImageInfo](#oh_drawing_imagegetimageinfo) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*) | Obtains the image information. After this function is called, the passed-in image information object is filled.| 388| [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \* [OH_Drawing_ImageFilterCreateBlur](#oh_drawing_imagefiltercreateblur) (float sigmaX, float sigmaY, [OH_Drawing_TileMode](#oh_drawing_tilemode), [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*input) | Creates an **OH_Drawing_ImageFilter** object with a given blur type.| 389| [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \* [OH_Drawing_ImageFilterCreateFromColorFilter](#oh_drawing_imagefiltercreatefromcolorfilter) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter, [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*input) | Creates an **OH_Drawing_ImageFilter** object with a color filter effect.| 390| void [OH_Drawing_ImageFilterDestroy](#oh_drawing_imagefilterdestroy) ([OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*) | Destroys an **OH_Drawing_ImageFilter** object and reclaims the memory occupied by the object.| 391| [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \* [OH_Drawing_MaskFilterCreateBlur](#oh_drawing_maskfiltercreateblur) ([OH_Drawing_BlurType](#oh_drawing_blurtype) blurType, float sigma, bool respectCTM) | Creates an **OH_Drawing_MaskFilter** object with a given blur type.| 392| void [OH_Drawing_MaskFilterDestroy](#oh_drawing_maskfilterdestroy) ([OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \*) | Destroys an **OH_Drawing_MaskFilter** object and reclaims the memory occupied by the object.| 393| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate) (void) | Creates an **OH_Drawing_Matrix** object.| 394| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateRotation](#oh_drawing_matrixcreaterotation) (float deg, float x, float y) | Creates an **OH_Drawing_Matrix** with the rotation attribute. The matrix is obtained by rotating an identity matrix by a given degree around the rotation point (x, y).| 395| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateScale](#oh_drawing_matrixcreatescale) (float sx, float sy, float px, float py) | Creates an **OH_Drawing_Matrix** with the scale attribute. The matrix is obtained by scaling an identity matrix with the factor (sx, sy) at the rotation point (px, py).| 396| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateTranslation](#oh_drawing_matrixcreatetranslation) (float dx, float dy) | Creates an **OH_Drawing_Matrix** with the translation attribute. The matrix is obtained by translating the identity matrix by the distance (dx, dy).| 397| void [OH_Drawing_MatrixSetMatrix](#oh_drawing_matrixsetmatrix) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2) | Sets matrix parameters for an **OH_Drawing_Matrix** object.| 398| bool [OH_Drawing_MatrixSetRectToRect](#oh_drawing_matrixsetrecttorect) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit) stf) | Scales a matrix to map a source rectangle to a destination rectangle.| 399| void [OH_Drawing_MatrixPreRotate](#oh_drawing_matrixprerotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Premultiplies a matrix by an identity matrix that rotates by a given degree around the rotation point (px, py). | 400| void [OH_Drawing_MatrixPreScale](#oh_drawing_matrixprescale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Premultiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py). | 401| void [OH_Drawing_MatrixPreTranslate](#oh_drawing_matrixpretranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Premultiplies a matrix by an identity matrix that translates by a given distance (dx, dy). | 402| void [OH_Drawing_MatrixPostRotate](#oh_drawing_matrixpostrotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Post multiplies a matrix by an identity matrix that rotates a given degree around the rotation point (px, py). | 403| void [OH_Drawing_MatrixPostScale](#oh_drawing_matrixpostscale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py). | 404| void [OH_Drawing_MatrixPostTranslate](#oh_drawing_matrixposttranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Post multiplies a matrix by an identity matrix that translates by a given distance (dx, dy). | 405| void [OH_Drawing_MatrixReset](#oh_drawing_matrixreset) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Resets a matrix to an identity matrix: \| 1 0 0 \| \| 0 1 0 \| \| 0 0 1 \| | 406| void [OH_Drawing_MatrixConcat](#oh_drawing_matrixconcat) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*total, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*a, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*b) | Multiplies two matrices to produce a new matrix. For example, if a given matrix a and a given matrix b are shown as follows:\| A B C \| \| J K L \| a = \| D E F \|, b = \| M N O \| \| G H I \| \| P Q R \| then the final matrix total is as follows:\| A B C \| \| J K L \| \| AJ+BM+CP AK+BN+CQ AL+BO+CR \| total = a \* b = \| D E F \| \* \| M N O \| = \| DJ+EM+FP DK+EN+FQ DL+EO+FR \| \| G H I \| \| P Q R \| \| GJ+HM+IP GK+HN+IQ GL+HO+IR \| | 407| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_MatrixGetAll](#oh_drawing_matrixgetall) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*matrix, float value[9]) | Obtains all element values of a matrix.| 408| float [OH_Drawing_MatrixGetValue](#oh_drawing_matrixgetvalue) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, int index) | Obtains a matrix value of a given index, which ranges from 0 to 8.| 409| void [OH_Drawing_MatrixRotate](#oh_drawing_matrixrotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Sets a matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py).| 410| void [OH_Drawing_MatrixTranslate](#oh_drawing_matrixtranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Sets a matrix as an identity matrix and translates it by a given distance (dx, dy).| 411| void [OH_Drawing_MatrixScale](#oh_drawing_matrixscale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py).| 412| bool [OH_Drawing_MatrixInvert](#oh_drawing_matrixinvert) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*inverse) | Inverts a matrix and returns the result.| 413| bool [OH_Drawing_MatrixSetPolyToPoly](#oh_drawing_matrixsetpolytopoly) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*src, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*dst, uint32_t count) | Generates a transformation matrix by setting source points and destination points. Both the number of source points and that of destination points must be in the range [0, 4].| 414| void [OH_Drawing_MatrixMapPoints](#oh_drawing_matrixmappoints) (const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*src, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*dst, int count) | Maps a source point array to a destination point array by means of matrix transformation.| 415| bool [OH_Drawing_MatrixMapRect](#oh_drawing_matrixmaprect) (const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, [OH_Drawing_Rect](#oh_drawing_rect) \*dst) | Maps a rectangle to the smallest rectangle that can enclose the vertices to which the four source vertices are mapped by means of matrix transformation.| 416| bool [OH_Drawing_MatrixIsEqual](#oh_drawing_matrixisequal) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*other) | Checks whether two **OH_Drawing_Matrix** objects are equal.| 417| bool [OH_Drawing_MatrixIsIdentity](#oh_drawing_matrixisidentity) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Checks whether an **OH_Drawing_Matrix** object is an identity matrix: \| 1 0 0 \| \| 0 1 0 \| \| 0 0 1 \| | 418| void [OH_Drawing_MatrixDestroy](#oh_drawing_matrixdestroy) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Destroys an **OH_Drawing_Matrix** object and reclaims the memory occupied by the object.| 419| [OH_Drawing_MemoryStream](#oh_drawing_memorystream) \* [OH_Drawing_MemoryStreamCreate](#oh_drawing_memorystreamcreate) (const void \*data, size_t length, bool copyData) | Creates an **OH_Drawing_MemoryStream** object.| 420| void [OH_Drawing_MemoryStreamDestroy](#oh_drawing_memorystreamdestroy) ([OH_Drawing_MemoryStream](#oh_drawing_memorystream) \*) | Destroys an **OH_Drawing_MemoryStream** object and reclaims the memory occupied by the object.| 421| [OH_Drawing_Path](#oh_drawing_path) \* [OH_Drawing_PathCreate](#oh_drawing_pathcreate) (void) | Creates an **OH_Drawing_Path** object.| 422| [OH_Drawing_Path](#oh_drawing_path) \* [OH_Drawing_PathCopy](#oh_drawing_pathcopy) ([OH_Drawing_Path](#oh_drawing_path) \*) | Copies an existing [OH_Drawing_Path](#oh_drawing_path) object to create a new one.| 423| void [OH_Drawing_PathDestroy](#oh_drawing_pathdestroy) ([OH_Drawing_Path](#oh_drawing_path) \*) | Destroys an **OH_Drawing_Path** object and reclaims the memory occupied by the object.| 424| void [OH_Drawing_PathMoveTo](#oh_drawing_pathmoveto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Sets the start point of a path.| 425| void [OH_Drawing_PathLineTo](#oh_drawing_pathlineto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Draws a line segment from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.| 426| void [OH_Drawing_PathArcTo](#oh_drawing_patharcto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) | Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle is specified first, and then a start angle and a sweep angle are specified. The inscribed ellipse of the rectangle will be used to intercept the arc. The arc is a portion of the ellipse defined by the start angle and the sweep angle. If the path is empty, a line segment from the last point of the path to the start point of the arc is also added.| 427| void [OH_Drawing_PathQuadTo](#oh_drawing_pathquadto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.| 428| void [OH_Drawing_PathConicTo](#oh_drawing_pathconicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.| 429| void [OH_Drawing_PathCubicTo](#oh_drawing_pathcubicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.| 430| void [OH_Drawing_PathRMoveTo](#oh_drawing_pathrmoveto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is used.| 431| void [OH_Drawing_PathRLineTo](#oh_drawing_pathrlineto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Draws a line segment from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.| 432| void [OH_Drawing_PathRQuadTo](#oh_drawing_pathrquadto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.| 433| void [OH_Drawing_PathRConicTo](#oh_drawing_pathrconicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.| 434| void [OH_Drawing_PathRCubicTo](#oh_drawing_pathrcubicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.| 435| void [OH_Drawing_PathAddRect](#oh_drawing_pathaddrect) ([OH_Drawing_Path](#oh_drawing_path) \*, float left, float top, float right, float bottom, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a rectangle contour to a path in the specified direction.| 436| void [OH_Drawing_PathAddRectWithInitialCorner](#oh_drawing_pathaddrectwithinitialcorner) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_PathDirection](#oh_drawing_pathdirection), uint32_t start) | Adds a rectangle contour to a path in the specified direction.| 437| void [OH_Drawing_PathAddRoundRect](#oh_drawing_pathaddroundrect) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*roundRect, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a rounded rectangle to a path in the specified direction.| 438| void [OH_Drawing_PathAddOvalWithInitialPoint](#oh_drawing_pathaddovalwithinitialpoint) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, uint32_t start, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds an oval to a path. **OH_Drawing_Rect** specifies the outer tangent rectangle of the oval, and **OH_Drawing_PathDirection** specifies whether the drawing is clockwise or anticlockwise.| 439| void [OH_Drawing_PathAddArc](#oh_drawing_pathaddarc) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, float startAngle, float sweepAngle) | Adds an arc to a path as the start of a new contour. The arc added is part of the inscribed ellipse of the rectangle, from the start angle through the sweep angle. If the sweep angle is less than or equal to -360°, or if the sweep angle is greater than or equal to 360°, and start angle modulo 90 is nearly zero, an oval instead of an ellipse is added.| 440| void [OH_Drawing_PathAddPath](#oh_drawing_pathaddpath) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Transforms the points in a **src** path by a matrix and adds the new one to the current path.| 441| void [OH_Drawing_PathAddPathWithMatrixAndMode](#oh_drawing_pathaddpathwithmatrixandmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Transforms the points in a **src** path by a matrix and adds the new one to the current path with the specified adding mode.| 442| void [OH_Drawing_PathAddPathWithMode](#oh_drawing_pathaddpathwithmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Adds a **src** path to the current path with the specified adding mode.| 443| void [OH_Drawing_PathAddPathWithOffsetAndMode](#oh_drawing_pathaddpathwithoffsetandmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, float dx, float dy, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Translates a **src** path by an offset and adds the new one to the current path with the specified adding mode.| 444| void [OH_Drawing_PathAddPolygon](#oh_drawing_pathaddpolygon) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*points, uint32_t count, bool isClosed) | Adds a polygon to a path.| 445| void [OH_Drawing_PathAddCircle](#oh_drawing_pathaddcircle) ([OH_Drawing_Path](#oh_drawing_path) \*path, float x, float y, float radius, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a circle to a path in the specified direction.| 446| void [OH_Drawing_PathAddOval](#oh_drawing_pathaddoval) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds an oval to a path in the specified direction.| 447| bool [OH_Drawing_PathBuildFromSvgString](#oh_drawing_pathbuildfromsvgstring) ([OH_Drawing_Path](#oh_drawing_path) \*path, const char \*str) | Parses the path represented by an SVG string.| 448| bool [OH_Drawing_PathContains](#oh_drawing_pathcontains) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Checks whether a coordinate point is included in this path. For details, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype).| 449| void [OH_Drawing_PathTransform](#oh_drawing_pathtransform) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Transforms the points in a path by a matrix.| 450| void [OH_Drawing_PathTransformWithPerspectiveClip](#oh_drawing_pathtransformwithperspectiveclip) ([OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Path](#oh_drawing_path) \*dst, bool applyPerspectiveClip) | Transforms the points in a **src** path by a matrix and uses the new one to replace the **dst** path. If **dst** is NULL, the **src** path is replaced.| 451| void [OH_Drawing_PathSetFillType](#oh_drawing_pathsetfilltype) ([OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_PathFillType](#oh_drawing_pathfilltype)) | Sets the fill type for a path.| 452| float [OH_Drawing_PathGetLength](#oh_drawing_pathgetlength) ([OH_Drawing_Path](#oh_drawing_path) \*, bool forceClosed) | Obtains the length of a path.| 453| void [OH_Drawing_PathGetBounds](#oh_drawing_pathgetbounds) ([OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the minimum bounds that enclose a path.| 454| void [OH_Drawing_PathClose](#oh_drawing_pathclose) ([OH_Drawing_Path](#oh_drawing_path) \*) | Closes a path by drawing a line segment from the current point to the start point of the path.| 455| bool [OH_Drawing_PathIsClosed](#oh_drawing_pathisclosed) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed) | Checks whether a path is closed.| 456| bool [OH_Drawing_PathGetPositionTangent](#oh_drawing_pathgetpositiontangent) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed, float distance, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*position, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*tangent) | Obtains the coordinates and tangent at a distance from the start point of a path.| 457| bool [OH_Drawing_PathOp](#oh_drawing_pathop) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*other, [OH_Drawing_PathOpMode](#oh_drawing_pathopmode) op) | Combines two paths based on the specified operation mode.| 458| bool [OH_Drawing_PathGetMatrix](#oh_drawing_pathgetmatrix) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed, float distance, [OH_Drawing_Matrix](#oh_drawing_matrix) \*matrix, [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags) flag) | Obtains a transformation matrix at a distance from the start point of a path.| 459| void [OH_Drawing_PathOffset](#oh_drawing_pathoffset) ([OH_Drawing_Path](#oh_drawing_path) \*path, [OH_Drawing_Path](#oh_drawing_path) \*dst, float dx, float dy) | Translates a path by an offset along the X axis and Y axis and adds the new one to the **dst** path.| 460| void [OH_Drawing_PathReset](#oh_drawing_pathreset) ([OH_Drawing_Path](#oh_drawing_path) \*) | Resets path data.| 461| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateDashPathEffect](#oh_drawing_createdashpatheffect) (float \*intervals, int count, float phase) | Creates an **OH_Drawing_PathEffect** object with a dashed line effect. The dashed line effect is determined by a group of "on" and "off" intervals.| 462| void [OH_Drawing_PathEffectDestroy](#oh_drawing_patheffectdestroy) ([OH_Drawing_PathEffect](#oh_drawing_patheffect) \*) | Destroys an **OH_Drawing_PathEffect** object and reclaims the memory occupied by the object.| 463| [OH_Drawing_Pen](#oh_drawing_pen) \* [OH_Drawing_PenCreate](#oh_drawing_pencreate) (void) | Creates an **OH_Drawing_Pen** object.| 464| [OH_Drawing_Pen](#oh_drawing_pen) \* [OH_Drawing_PenCopy](#oh_drawing_pencopy) ([OH_Drawing_Pen](#oh_drawing_pen) \*pen) | Copies an existing [OH_Drawing_Pen](#oh_drawing_pen) object to create a new one.| 465| void [OH_Drawing_PenDestroy](#oh_drawing_pendestroy) ([OH_Drawing_Pen](#oh_drawing_pen) \*) | Destroys an **OH_Drawing_Pen** object and reclaims the memory occupied by the object.| 466| bool [OH_Drawing_PenIsAntiAlias](#oh_drawing_penisantialias) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.| 467| void [OH_Drawing_PenSetAntiAlias](#oh_drawing_pensetantialias) ([OH_Drawing_Pen](#oh_drawing_pen) \*, bool) | Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.| 468| uint32_t [OH_Drawing_PenGetColor](#oh_drawing_pengetcolor) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the color of a pen. The color is used by the pen to outline a shape.| 469| void [OH_Drawing_PenSetColor](#oh_drawing_pensetcolor) ([OH_Drawing_Pen](#oh_drawing_pen) \*, uint32_t color) | Sets the color for a pen. The color is used by the pen to outline a shape.| 470| uint8_t [OH_Drawing_PenGetAlpha](#oh_drawing_pengetalpha) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape.| 471| void [OH_Drawing_PenSetAlpha](#oh_drawing_pensetalpha) ([OH_Drawing_Pen](#oh_drawing_pen) \*, uint8_t alpha) | Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape.| 472| float [OH_Drawing_PenGetWidth](#oh_drawing_pengetwidth) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.| 473| void [OH_Drawing_PenSetWidth](#oh_drawing_pensetwidth) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float width) | Sets the thickness for a pen. This thickness determines the width of the outline of a shape.| 474| float [OH_Drawing_PenGetMiterLimit](#oh_drawing_pengetmiterlimit) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the stroke miter limit of a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.| 475| void [OH_Drawing_PenSetMiterLimit](#oh_drawing_pensetmiterlimit) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float miter) | Sets the stroke miter limit for a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.| 476| [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) [OH_Drawing_PenGetCap](#oh_drawing_pengetcap) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the line cap style of a pen.| 477| void [OH_Drawing_PenSetCap](#oh_drawing_pensetcap) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle)) | Sets the line cap style for a pen.| 478| [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) [OH_Drawing_PenGetJoin](#oh_drawing_pengetjoin) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the line join style of a pen.| 479| void [OH_Drawing_PenSetJoin](#oh_drawing_pensetjoin) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle)) | Sets the line join style for a pen.| 480| void [OH_Drawing_PenSetShaderEffect](#oh_drawing_pensetshadereffect) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Sets the shader effect for a pen.| 481| void [OH_Drawing_PenSetShadowLayer](#oh_drawing_pensetshadowlayer) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn.| 482| void [OH_Drawing_PenSetPathEffect](#oh_drawing_pensetpatheffect) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PathEffect](#oh_drawing_patheffect) \*) | Sets the path effect for a pen.| 483| void [OH_Drawing_PenSetFilter](#oh_drawing_pensetfilter) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Sets a filter for a pen.| 484| void [OH_Drawing_PenGetFilter](#oh_drawing_pengetfilter) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Obtains the filter of a pen. The filter is a container that holds a mask filter and color filter.| 485| void [OH_Drawing_PenSetBlendMode](#oh_drawing_pensetblendmode) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Sets a blender for a pen. The blender implements the specified blend mode.| 486| bool [OH_Drawing_PenGetFillPath](#oh_drawing_pengetfillpath) ([OH_Drawing_Pen](#oh_drawing_pen) \*, const [OH_Drawing_Path](#oh_drawing_path) \*src, [OH_Drawing_Path](#oh_drawing_path) \*dst, const [OH_Drawing_Rect](#oh_drawing_rect) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Obtains the source path outline drawn using a pen and represents it using a destination path.| 487| void [OH_Drawing_PenReset](#oh_drawing_penreset) ([OH_Drawing_Pen](#oh_drawing_pen) \*) | Resets a pen to the initial state.| 488| [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \* [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) (NativePixelMap_ \*) | Obtains the pixel map defined by this module from a pixel map defined by the image framework.| 489| [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \* [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative) (OH_PixelmapNative \*) | Obtains the pixel map defined by this module from a pixel map defined by the image framework.| 490| void [OH_Drawing_PixelMapDissolve](#oh_drawing_pixelmapdissolve) ([OH_Drawing_PixelMap](#oh_drawing_pixelmap) \*) | Removes the relationship between a pixel map defined by this module and a pixel map defined by the image framework. The relationship is established by calling [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) or [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative).| 491| [OH_Drawing_Point](#oh_drawing_point) \* [OH_Drawing_PointCreate](#oh_drawing_pointcreate) (float x, float y) | Creates an **OH_Drawing_Point** object.| 492| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointGetX](#oh_drawing_pointgetx) (const [OH_Drawing_Point](#oh_drawing_point) \*point, float \*x) | Obtains the X coordinate of a point.| 493| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointGetY](#oh_drawing_pointgety) (const [OH_Drawing_Point](#oh_drawing_point) \*point, float \*y) | Obtains the Y coordinate of a point.| 494| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointSet](#oh_drawing_pointset) ([OH_Drawing_Point](#oh_drawing_point) \*point, float x, float y) | Sets the X and Y coordinates of a point.| 495| void [OH_Drawing_PointDestroy](#oh_drawing_pointdestroy) ([OH_Drawing_Point](#oh_drawing_point) \*) | Destroys an **OH_Drawing_Point** object and reclaims the memory occupied by the object.| 496| [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \* [OH_Drawing_RecordCmdUtilsCreate](#oh_drawing_recordcmdutilscreate) (void) | Creates an **OH_Drawing_RecordCmdUtils** object.| 497| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsDestroy](#oh_drawing_recordcmdutilsdestroy) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils) | Destroys an **OH_Drawing_RecordCmdUtils** object and reclaims the memory occupied by the object.| 498| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils, int32_t width, int32_t height, [OH_Drawing_Canvas](#oh_drawing_canvas) \*\*canvas) | Starts recording. This function must be used in pair with [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording).<br>The **OH_Drawing_RecordCmdUtils** object generates a canvas object of the recording type and calls the interface of the drawing object to record all drawing commands.| 499| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils, [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*\*recordCmd) | Ends recording. This function must be called after [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording).<br>The **OH_Drawing_RecordCmdUtils** object ends recording and stores the drawing commands recorded by the canvas object of the recording type into the generated [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) object.| 500| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdDestroy](#oh_drawing_recordcmddestroy) ([OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*recordCmd) | Destroys an **OH_Drawing_RecordCmd** object and reclaims the memory occupied by the object.| 501| [OH_Drawing_Rect](#oh_drawing_rect) \* [OH_Drawing_RectCreate](#oh_drawing_rectcreate) (float left, float top, float right, float bottom) | Creates an **OH_Drawing_Rect** object, without sorting the coordinates passed in. This means that the coordinates of the upper left corner of the rectangle can be greater than those of the lower right corner.| 502| float [OH_Drawing_RectGetHeight](#oh_drawing_rectgetheight) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the height of a rectangle. The height is calculated by using the Y coordinate of the lower right corner of the rectangle minus the Y coordinate of the upper left corner.| 503| float [OH_Drawing_RectGetWidth](#oh_drawing_rectgetwidth) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the width of a rectangle. The width is calculated by using the X coordinate of the lower right corner of the rectangle minus the X coordinate of the upper left corner.| 504| float [OH_Drawing_RectGetLeft](#oh_drawing_rectgetleft) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the X coordinate of the upper left corner of a rectangle.| 505| float [OH_Drawing_RectGetTop](#oh_drawing_rectgettop) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the Y coordinate of the upper left corner of a rectangle.| 506| float [OH_Drawing_RectGetRight](#oh_drawing_rectgetright) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the X coordinate of the lower right corner of a rectangle.| 507| float [OH_Drawing_RectGetBottom](#oh_drawing_rectgetbottom) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the Y coordinate of the lower right corner of a rectangle.| 508| bool [OH_Drawing_RectIntersect](#oh_drawing_rectintersect) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, const [OH_Drawing_Rect](#oh_drawing_rect) \*other) | Checks whether two rectangles intersect and if yes, sets **rect** to the area of intersection.| 509| bool [OH_Drawing_RectJoin](#oh_drawing_rectjoin) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, const [OH_Drawing_Rect](#oh_drawing_rect) \*other) | Obtains the union of two rectangles.| 510| void [OH_Drawing_RectSetLeft](#oh_drawing_rectsetleft) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float left) | Sets the horizontal coordinate of the upper left corner of a rectangle.| 511| void [OH_Drawing_RectSetTop](#oh_drawing_rectsettop) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float top) | Sets the vertical coordinate of the upper left corner of a rectangle.| 512| void [OH_Drawing_RectSetRight](#oh_drawing_rectsetright) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float right) | Sets the horizontal coordinate of the lower right corner of a rectangle.| 513| void [OH_Drawing_RectSetBottom](#oh_drawing_rectsetbottom) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float bottom) | Sets the vertical coordinate of the lower right corner of a rectangle.| 514| void [OH_Drawing_RectCopy](#oh_drawing_rectcopy) ([OH_Drawing_Rect](#oh_drawing_rect) \*sRect, [OH_Drawing_Rect](#oh_drawing_rect) \*dRect) | Copies a source rectangle to create a new one.| 515| void [OH_Drawing_RectDestroy](#oh_drawing_rectdestroy) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Destroys an **OH_Drawing_Rect** object and reclaims the memory occupied by the object.| 516| [OH_Drawing_Region](#oh_drawing_region) \* [OH_Drawing_RegionCreate](#oh_drawing_regioncreate) (void) | Creates an **OH_Drawing_Region** object for more accurate graphical control.| 517| bool [OH_Drawing_RegionContains](#oh_drawing_regioncontains) ([OH_Drawing_Region](#oh_drawing_region) \*region, int32_t x, int32_t y) | Checks whether a region contains the specified point.| 518| bool [OH_Drawing_RegionOp](#oh_drawing_regionop) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Region](#oh_drawing_region) \*other, [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode) op) | Combines two regions based on the specified operation mode.| 519| bool [OH_Drawing_RegionSetRect](#oh_drawing_regionsetrect) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Rect](#oh_drawing_rect) \*rect) | Sets the boundary for an **OH_Drawing_Region** object.| 520| bool [OH_Drawing_RegionSetPath](#oh_drawing_regionsetpath) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Region](#oh_drawing_region) \*clip) | Sets a region to the area described by the path.| 521| void [OH_Drawing_RegionDestroy](#oh_drawing_regiondestroy) ([OH_Drawing_Region](#oh_drawing_region) \*) | Destroys an **OH_Drawing_Region** object and reclaims the memory occupied by the object.| 522| uint32_t [OH_Drawing_RegisterFont](#oh_drawing_registerfont) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*, const char \*fontFamily, const char \*familySrc) | Registers a custom font with the font manager. The supported font file formats are .ttf and .otf.| 523| uint32_t [OH_Drawing_RegisterFontBuffer](#oh_drawing_registerfontbuffer) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*, const char \*fontFamily, uint8_t \*fontBuffer, size_t length) | Registers a font buffer with the font manager.| 524| [OH_Drawing_RoundRect](#oh_drawing_roundrect) \* [OH_Drawing_RoundRectCreate](#oh_drawing_roundrectcreate) (const [OH_Drawing_Rect](#oh_drawing_rect) \*, float xRad, float yRad) | Creates an **OH_Drawing_RoundRect** object.| 525| void [OH_Drawing_RoundRectSetCorner](#oh_drawing_roundrectsetcorner) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CornerPos](#oh_drawing_cornerpos) pos, [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii)) | Sets the radii of the specified rounded corner in a rounded rectangle.| 526| [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) [OH_Drawing_RoundRectGetCorner](#oh_drawing_roundrectgetcorner) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CornerPos](#oh_drawing_cornerpos) pos) | Obtains the radii of the specified rounded corner in a rounded rectangle.| 527| void [OH_Drawing_RoundRectDestroy](#oh_drawing_roundrectdestroy) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*) | Destroys an **OH_Drawing_RoundRect** object and reclaims the memory occupied by the object.| 528| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RoundRectOffset](#oh_drawing_roundrectoffset) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*roundRect, float dx, float dy) | Translates a rounded rectangle by an offset along the X axis and Y axis.| 529| [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \* [OH_Drawing_SamplingOptionsCreate](#oh_drawing_samplingoptionscreate) ([OH_Drawing_FilterMode](#oh_drawing_filtermode), [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode)) | Creates an **OH_Drawing_SamplingOptions** object.| 530| void [OH_Drawing_SamplingOptionsDestroy](#oh_drawing_samplingoptionsdestroy) ([OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Destroys an **OH_Drawing_SamplingOptions** object and reclaims the memory occupied by the object.| 531| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateColorShader](#oh_drawing_shadereffectcreatecolorshader) (const uint32_t color) | Creates an **OH_Drawing_ShaderEffect** object with a single color.| 532| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateLinearGradient](#oh_drawing_shadereffectcreatelineargradient) (const [OH_Drawing_Point](#oh_drawing_point) \*startPt, const [OH_Drawing_Point](#oh_drawing_point) \*endPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.| 533| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix](#oh_drawing_shadereffectcreatelineargradientwithlocalmatrix) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*startPt, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*endPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.| 534| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateRadialGradient](#oh_drawing_shadereffectcreateradialgradient) (const [OH_Drawing_Point](#oh_drawing_point) \*centerPt, float radius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.| 535| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix](#oh_drawing_shadereffectcreateradialgradientwithlocalmatrix) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*centerPt, float radius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.| 536| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateSweepGradient](#oh_drawing_shadereffectcreatesweepgradient) (const [OH_Drawing_Point](#oh_drawing_point) \*centerPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the center. A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°.| 537| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateImageShader](#oh_drawing_shadereffectcreateimageshader) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_TileMode](#oh_drawing_tilemode) tileX, [OH_Drawing_TileMode](#oh_drawing_tilemode) tileY, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object for an image shader. You are advised not to use the API for the canvas of the capture type because it affects the performance.| 538| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateTwoPointConicalGradient](#oh_drawing_shadereffectcreatetwopointconicalgradient) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*startPt, float startRadius, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*endPt, float endRadius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a gradient between two given circles.| 539| void [OH_Drawing_ShaderEffectDestroy](#oh_drawing_shadereffectdestroy) ([OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Destroys an **OH_Drawing_ShaderEffect** object and reclaims the memory occupied by the object.| 540| [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \* [OH_Drawing_ShadowLayerCreate](#oh_drawing_shadowlayercreate) (float blurRadius, float x, float y, uint32_t color) | Creates an **OH_Drawing_ShadowLayer** object.| 541| void [OH_Drawing_ShadowLayerDestroy](#oh_drawing_shadowlayerdestroy) ([OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Destroys an **OH_Drawing_ShadowLayer** object and reclaims the memory occupied by the object.| 542| [OH_Drawing_Surface](#oh_drawing_surface) \* [OH_Drawing_SurfaceCreateFromGpuContext](#oh_drawing_surfacecreatefromgpucontext) ([OH_Drawing_GpuContext](#oh_drawing_gpucontext) \*, bool budgeted, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md)) | Creates an **OH_Drawing_Surface** object using the GPU context to manage the content drawn on the canvas.| 543| [OH_Drawing_Canvas](#oh_drawing_canvas) \* [OH_Drawing_SurfaceGetCanvas](#oh_drawing_surfacegetcanvas) ([OH_Drawing_Surface](#oh_drawing_surface) \*) | Obtains a canvas from an **OH_Drawing_Surface** object.| 544| void [OH_Drawing_SurfaceDestroy](#oh_drawing_surfacedestroy) ([OH_Drawing_Surface](#oh_drawing_surface) \*) | Destroys an **OH_Drawing_Surface** object and reclaims the memory occupied.| 545| [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \* [OH_Drawing_TextBlobBuilderCreate](#oh_drawing_textblobbuildercreate) (void) | Creates an **OH_Drawing_TextBlobBuilder** object.| 546| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromText](#oh_drawing_textblobcreatefromtext) (const void \*text, size_t byteLength, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from the text.| 547| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromPosText](#oh_drawing_textblobcreatefrompostext) (const void \*text, size_t byteLength, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from the text. The coordinates of each character in the **OH_Drawing_TextBlob** object are determined by the coordinate information in the **OH_Drawing_Point2D** array.| 548| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromString](#oh_drawing_textblobcreatefromstring) (const char \*str, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from a string.| 549| void [OH_Drawing_TextBlobGetBounds](#oh_drawing_textblobgetbounds) ([OH_Drawing_TextBlob](#oh_drawing_textblob) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the bounds of an **OH_Drawing_TextBlob** object.| 550| uint32_t [OH_Drawing_TextBlobUniqueID](#oh_drawing_textblobuniqueid) (const [OH_Drawing_TextBlob](#oh_drawing_textblob) \*) | Obtains the unique identifier of a text blob. The identifier is a non-zero value.| 551| const [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md) \* [OH_Drawing_TextBlobBuilderAllocRunPos](#oh_drawing_textblobbuilderallocrunpos) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*, const [OH_Drawing_Font](#oh_drawing_font) \*, int32_t count, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Allocates a run to store glyphs and positions. The pointer returned does not need to be managed by the caller. It can no longer be used after [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) is called.| 552| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*) | Makes an **OH_Drawing_TextBlob** object from an **OH_Drawing_TextBlobBuilder**.| 553| void [OH_Drawing_TextBlobDestroy](#oh_drawing_textblobdestroy) ([OH_Drawing_TextBlob](#oh_drawing_textblob) \*) | Destroys an **OH_Drawing_TextBlob** object and reclaims the memory occupied by the object.| 554| void [OH_Drawing_TextBlobBuilderDestroy](#oh_drawing_textblobbuilderdestroy) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*) | Destroys an **OH_Drawing_TextBlobBuilder** object and reclaims the memory occupied by the object.| 555| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_GetFontDescriptorByFullName](#oh_drawing_getfontdescriptorbyfullname) (const [OH_Drawing_String](_o_h___drawing___string.md) \*, [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype)) | Obtains a font descriptor based on the font name and type. System fonts, style fonts, and user-installed fonts are supported. A font descriptor is a data structure that describes font features. It contains details of the font appearance and properties.| 556| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_GetSystemFontFullNamesByType](#oh_drawing_getsystemfontfullnamesbytype) ([OH_Drawing_SystemFontType](#oh_drawing_systemfonttype)) | Obtains an array of font names by font type.| 557| const [OH_Drawing_String](_o_h___drawing___string.md) \* [OH_Drawing_GetSystemFontFullNameByIndex](#oh_drawing_getsystemfontfullnamebyindex) ([OH_Drawing_Array](#oh_drawing_array) \*, size_t) | Obtains the font name with the specified index in the font name array.| 558| void [OH_Drawing_DestroySystemFontFullNames](#oh_drawing_destroysystemfontfullnames) ([OH_Drawing_Array](#oh_drawing_array) \*) | Releases the memory occupied by the font name array obtained by font type.| 559| [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \* [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle) (void) | Creates an **OH_Drawing_TypographyStyle** object.| 560| void [OH_Drawing_DestroyTypographyStyle](#oh_drawing_destroytypographystyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Destroys an **OH_Drawing_TypographyStyle** object and reclaims the memory occupied by the object.| 561| void [OH_Drawing_SetTypographyTextDirection](#oh_drawing_settypographytextdirection) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text direction.| 562| void [OH_Drawing_SetTypographyTextAlign](#oh_drawing_settypographytextalign) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text alignment mode.| 563| int [OH_Drawing_TypographyGetEffectiveAlignment](#oh_drawing_typographygeteffectivealignment) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the text alignment mode.| 564| void [OH_Drawing_SetTypographyTextMaxLines](#oh_drawing_settypographytextmaxlines) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the maximum number of lines in the text.| 565| [OH_Drawing_TextStyle](#oh_drawing_textstyle) \* [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle) (void) | Creates an **OH_Drawing_TextStyle** object.| 566| [OH_Drawing_TextStyle](#oh_drawing_textstyle) \* [OH_Drawing_TypographyGetTextStyle](#oh_drawing_typographygettextstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the text style of a typography style.| 567| void [OH_Drawing_DestroyTextStyle](#oh_drawing_destroytextstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Destroys an **OH_Drawing_TextStyle** object and reclaims the memory occupied by the object.| 568| void [OH_Drawing_SetTextStyleColor](#oh_drawing_settextstylecolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | Sets the color for a text style.| 569| void [OH_Drawing_SetTextStyleFontSize](#oh_drawing_settextstylefontsize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the font size for a text style.| 570| void [OH_Drawing_SetTextStyleFontWeight](#oh_drawing_settextstylefontweight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the font weight for a text style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.| 571| void [OH_Drawing_SetTextStyleBaseLine](#oh_drawing_settextstylebaseline) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the baseline for a text style.| 572| void [OH_Drawing_SetTextStyleDecoration](#oh_drawing_settextstyledecoration) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the decoration for a text style.| 573| void [OH_Drawing_SetTextStyleDecorationColor](#oh_drawing_settextstyledecorationcolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | Sets the decoration color for a text style.| 574| void [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the line height based on the multiple of the font size.| 575| void [OH_Drawing_SetTextStyleFontFamilies](#oh_drawing_settextstylefontfamilies) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int, const char \*fontFamilies[]) | Sets the font families for a text style.| 576| void [OH_Drawing_SetTextStyleFontStyle](#oh_drawing_settextstylefontstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the font style for a text style.| 577| void [OH_Drawing_SetTextStyleLocale](#oh_drawing_settextstylelocale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*) | Sets the locale for a text style.| 578| void [OH_Drawing_SetTextStyleForegroundBrush](#oh_drawing_settextstyleforegroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Sets the foreground brush for a text style.| 579| void [OH_Drawing_TextStyleGetForegroundBrush](#oh_drawing_textstylegetforegroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the foreground brush of a text style.| 580| void [OH_Drawing_SetTextStyleForegroundPen](#oh_drawing_settextstyleforegroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Sets the foreground pen for a text style.| 581| void [OH_Drawing_TextStyleGetForegroundPen](#oh_drawing_textstylegetforegroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the foreground pen of a text style.| 582| void [OH_Drawing_SetTextStyleBackgroundBrush](#oh_drawing_settextstylebackgroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Sets the background brush for a text style.| 583| void [OH_Drawing_TextStyleGetBackgroundBrush](#oh_drawing_textstylegetbackgroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the background brush of a text style.| 584| void [OH_Drawing_SetTextStyleBackgroundPen](#oh_drawing_settextstylebackgroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Sets the background pen for a text style.| 585| void [OH_Drawing_TextStyleGetBackgroundPen](#oh_drawing_textstylegetbackgroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the background pen of a text style.| 586| [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \* [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Creates an **OH_Drawing_TypographyCreate** object.| 587| void [OH_Drawing_DestroyTypographyHandler](#oh_drawing_destroytypographyhandler) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Destroys an **OH_Drawing_TypographyCreate** object and reclaims the memory occupied by the object.| 588| void [OH_Drawing_TypographyHandlerPushTextStyle](#oh_drawing_typographyhandlerpushtextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Pushes the text style.| 589| void [OH_Drawing_TypographyHandlerAddText](#oh_drawing_typographyhandleraddtext) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, const char \*) | Adds text.| 590| void [OH_Drawing_TypographyHandlerPopTextStyle](#oh_drawing_typographyhandlerpoptextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Removes the topmost text style in the stack, leaving the remaining styles in effect.| 591| [OH_Drawing_Typography](#oh_drawing_typography) \* [OH_Drawing_CreateTypography](#oh_drawing_createtypography) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Creates an **OH_Drawing_Typography** object.| 592| void [OH_Drawing_DestroyTypography](#oh_drawing_destroytypography) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Destroys an **OH_Drawing_Typography** object and reclaims the memory occupied by the object.| 593| void [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double) | Lays out the typography.| 594| void [OH_Drawing_TypographyPaint](#oh_drawing_typographypaint) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_Canvas](#oh_drawing_canvas) \*, double, double) | Paints text on the canvas.| 595| void [OH_Drawing_TypographyPaintOnPath](#oh_drawing_typographypaintonpath) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Path](#oh_drawing_path) \*, double, double) | Draws text along a path.| 596| double [OH_Drawing_TypographyGetMaxWidth](#oh_drawing_typographygetmaxwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the maximum width.| 597| double [OH_Drawing_TypographyGetHeight](#oh_drawing_typographygetheight) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the height.| 598| double [OH_Drawing_TypographyGetLongestLine](#oh_drawing_typographygetlongestline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the width of the longest line. You are advised to round up the return value in actual use. When the text content is empty, the minimum float value, that is, -340282346638528859811704183484516925440.000000, is returned.| 599| double [OH_Drawing_TypographyGetLongestLineWithIndent](#oh_drawing_typographygetlongestlinewithindent) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the width of the longest line, including its indentation. You are advised to round up the return value in actual use. If the text content is empty, **0.0** is returned.| 600| double [OH_Drawing_TypographyGetMinIntrinsicWidth](#oh_drawing_typographygetminintrinsicwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the minimum intrinsic width.| 601| double [OH_Drawing_TypographyGetMaxIntrinsicWidth](#oh_drawing_typographygetmaxintrinsicwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the maximum intrinsic width.| 602| double [OH_Drawing_TypographyGetAlphabeticBaseline](#oh_drawing_typographygetalphabeticbaseline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the alphabetic baseline.| 603| double [OH_Drawing_TypographyGetIdeographicBaseline](#oh_drawing_typographygetideographicbaseline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the ideographic baseline.| 604| void [OH_Drawing_TypographyHandlerAddPlaceholder](#oh_drawing_typographyhandleraddplaceholder) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) \*) | Adds a placeholder.| 605| bool [OH_Drawing_TypographyDidExceedMaxLines](#oh_drawing_typographydidexceedmaxlines) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Checks whether the maximum number of lines is exceeded.| 606| [OH_Drawing_TextBox](#oh_drawing_textbox) \* [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t, size_t, [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle), [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle)) | Obtains text boxes in a given range.| 607| [OH_Drawing_TextBox](#oh_drawing_textbox) \* [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains text boxes for placeholders.| 608| float [OH_Drawing_GetLeftFromTextBox](#oh_drawing_getleftfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the left position of a text box.| 609| float [OH_Drawing_GetRightFromTextBox](#oh_drawing_getrightfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the right position of a text box.| 610| float [OH_Drawing_GetTopFromTextBox](#oh_drawing_gettopfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the top position of a text box.| 611| float [OH_Drawing_GetBottomFromTextBox](#oh_drawing_getbottomfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the bottom position of a text box.| 612| int [OH_Drawing_GetTextDirectionFromTextBox](#oh_drawing_gettextdirectionfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the text direction of a text box.| 613| size_t [OH_Drawing_GetSizeOfTextBox](#oh_drawing_getsizeoftextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*) | Obtains the number of text boxes.| 614| [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \* [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double, double) | Obtains the position and affinity of the glyph at the given coordinates.| 615| [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \* [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double, double) | Obtains the position and affinity of the glyph cluster to which the glyph at the given coordinates belongs. The glyph cluster is a container that holds one or more glyphs.| 616| size_t [OH_Drawing_GetPositionFromPositionAndAffinity](#oh_drawing_getpositionfrompositionandaffinity) ([OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \*) | Obtains the position attribute of an **OH_Drawing_PositionAndAffinity** object.| 617| int [OH_Drawing_GetAffinityFromPositionAndAffinity](#oh_drawing_getaffinityfrompositionandaffinity) ([OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \*) | Obtains the affinity attribute of an **OH_Drawing_PositionAndAffinity** object. The affinity determines whether the font is close to the front text or rear text.| 618| [OH_Drawing_Range](#oh_drawing_range) \* [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t) | Obtains the word boundary.| 619| size_t [OH_Drawing_GetStartFromRange](#oh_drawing_getstartfromrange) ([OH_Drawing_Range](#oh_drawing_range) \*) | Obtains the start position of an **OH_Drawing_Range** object.| 620| size_t [OH_Drawing_GetEndFromRange](#oh_drawing_getendfromrange) ([OH_Drawing_Range](#oh_drawing_range) \*) | Obtains the end position of an **OH_Drawing_Range** object.| 621| size_t [OH_Drawing_TypographyGetLineCount](#oh_drawing_typographygetlinecount) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the number of lines.| 622| void [OH_Drawing_SetTextStyleDecorationStyle](#oh_drawing_settextstyledecorationstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the decoration style for a text style.| 623| void [OH_Drawing_SetTextStyleDecorationThicknessScale](#oh_drawing_settextstyledecorationthicknessscale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the thickness scale factor for the decoration style of a text style.| 624| void [OH_Drawing_SetTextStyleLetterSpacing](#oh_drawing_settextstyleletterspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the letter spacing for a text style.| 625| void [OH_Drawing_SetTextStyleWordSpacing](#oh_drawing_settextstylewordspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the word spacing for a text style.| 626| void [OH_Drawing_SetTextStyleHalfLeading](#oh_drawing_settextstylehalfleading) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, bool) | Sets whether to enable half leading for a text style.| 627| void [OH_Drawing_SetTextStyleEllipsis](#oh_drawing_settextstyleellipsis) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*) | Sets the ellipsis content for a text style.| 628| void [OH_Drawing_SetTextStyleEllipsisModal](#oh_drawing_settextstyleellipsismodal) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the ellipsis style for a text style.| 629| void [OH_Drawing_SetTypographyTextBreakStrategy](#oh_drawing_settypographytextbreakstrategy) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text break strategy.| 630| void [OH_Drawing_SetTypographyTextWordBreakType](#oh_drawing_settypographytextwordbreaktype) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the word break type.| 631| void [OH_Drawing_SetTypographyTextEllipsisModal](#oh_drawing_settypographytextellipsismodal) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text ellipsis style.| 632| void [OH_Drawing_SetTypographyTextEllipsis](#oh_drawing_settypographytextellipsis) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, const char \*ellipsis) | Sets the text ellipsis content.| 633| double [OH_Drawing_TypographyGetLineHeight](#oh_drawing_typographygetlineheight) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains the line height.| 634| double [OH_Drawing_TypographyGetLineWidth](#oh_drawing_typographygetlinewidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains the line width.| 635| void [OH_Drawing_SetTypographyTextSplitRatio](#oh_drawing_settypographytextsplitratio) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, float textSplitRatio) | Sets the text split ratio.| 636| bool [OH_Drawing_TypographyIsLineUnlimited](#oh_drawing_typographyislineunlimited) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether the maximum number of lines is limited for text.| 637| bool [OH_Drawing_TypographyIsEllipsized](#oh_drawing_typographyisellipsized) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether the text has an ellipsis.| 638| void [OH_Drawing_SetTypographyTextLocale](#oh_drawing_settypographytextlocale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, const char \*locale) | Sets the locale for text.| 639| bool [OH_Drawing_TextStyleGetFontMetrics](#oh_drawing_textstylegetfontmetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Obtains the font metrics of a text style.| 640| void [OH_Drawing_SetTypographyTextStyle](#oh_drawing_settypographytextstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Sets a text style.| 641| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_CreateFontDescriptor](#oh_drawing_createfontdescriptor) (void) | Creates an **OH_Drawing_FontDescriptor** object to describe the detailed information about a system font.| 642| void [OH_Drawing_DestroyFontDescriptor](#oh_drawing_destroyfontdescriptor) ([OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \*) | Destroys an **OH_Drawing_FontDescriptor** object and reclaims the memory occupied by the object.| 643| [OH_Drawing_FontParser](#oh_drawing_fontparser) \* [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser) (void) | Creates an **OH_Drawing_FontParser** object to parse a system font.| 644| void [OH_Drawing_DestroyFontParser](#oh_drawing_destroyfontparser) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*) | Destroys an **OH_Drawing_FontParser** object and reclaims the memory occupied by the object.| 645| char \*\* [OH_Drawing_FontParserGetSystemFontList](#oh_drawing_fontparsergetsystemfontlist) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*, size_t \*) | Obtains the list of system fonts. This function can be used only on 2-in-1 devices.| 646| void [OH_Drawing_DestroySystemFontList](#oh_drawing_destroysystemfontlist) (char \*\*, size_t) | Reclaims the memory occupied by the system font list.| 647| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_FontParserGetFontByName](#oh_drawing_fontparsergetfontbyname) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*, const char \*) | Obtains the descriptor of a system font based on the font name.| 648| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \* [OH_Drawing_TypographyGetLineMetrics](#oh_drawing_typographygetlinemetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the line metrics.| 649| size_t [OH_Drawing_LineMetricsGetSize](#oh_drawing_linemetricsgetsize) ([OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the number of lines.| 650| void [OH_Drawing_DestroyLineMetrics](#oh_drawing_destroylinemetrics) ([OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Destroys an **OH_Drawing_LineMetrics** object and reclaims the memory occupied by the object.| 651| bool [OH_Drawing_TypographyGetLineMetricsAt](#oh_drawing_typographygetlinemetricsat) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the metrics of a given line.| 652| bool [OH_Drawing_TypographyGetLineInfo](#oh_drawing_typographygetlineinfo) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, bool, bool, [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the metrics of a given line or the metrics of the first character in a given line.| 653| void [OH_Drawing_SetTypographyTextFontWeight](#oh_drawing_settypographytextfontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the font weight for text. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.| 654| void [OH_Drawing_SetTypographyTextFontStyle](#oh_drawing_settypographytextfontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the font style for text.| 655| void [OH_Drawing_SetTypographyTextFontFamily](#oh_drawing_settypographytextfontfamily) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, const char \*) | Sets the font family name for text.| 656| void [OH_Drawing_SetTypographyTextFontSize](#oh_drawing_settypographytextfontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font size for text.| 657| void [OH_Drawing_SetTypographyTextFontHeight](#oh_drawing_settypographytextfontheight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font height for text.| 658| void [OH_Drawing_SetTypographyTextHalfLeading](#oh_drawing_settypographytexthalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable half leading for text.| 659| void [OH_Drawing_SetTypographyTextUseLineStyle](#oh_drawing_settypographytextuselinestyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable the text line style.| 660| void [OH_Drawing_SetTypographyTextLineStyleFontWeight](#oh_drawing_settypographytextlinestylefontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the font weight for a text line style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.| 661| void [OH_Drawing_SetTypographyTextLineStyleFontStyle](#oh_drawing_settypographytextlinestylefontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the font style for a text line style.| 662| void [OH_Drawing_SetTypographyTextLineStyleFontFamilies](#oh_drawing_settypographytextlinestylefontfamilies) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int, const char \*fontFamilies[]) | Sets the font families for a text line style.| 663| void [OH_Drawing_SetTypographyTextLineStyleFontSize](#oh_drawing_settypographytextlinestylefontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font size for a text line style.| 664| void [OH_Drawing_SetTypographyTextLineStyleFontHeight](#oh_drawing_settypographytextlinestylefontheight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font height for a text line style.| 665| void [OH_Drawing_SetTypographyTextLineStyleHalfLeading](#oh_drawing_settypographytextlinestylehalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable half leading for a text line style.| 666| void [OH_Drawing_SetTypographyTextLineStyleSpacingScale](#oh_drawing_settypographytextlinestylespacingscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the spacing scale factor for a text line style.| 667| void [OH_Drawing_SetTypographyTextLineStyleOnly](#oh_drawing_settypographytextlinestyleonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable the text line style only.| 668| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow) (void) | Creates an **OH_Drawing_TextShadow** object.| 669| void [OH_Drawing_DestroyTextShadow](#oh_drawing_destroytextshadow) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Destroys an **OH_Drawing_TextShadow** object and reclaims the memory occupied by the object.| 670| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_TextStyleGetShadows](#oh_drawing_textstylegetshadows) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains a text shadow container.| 671| int [OH_Drawing_TextStyleGetShadowCount](#oh_drawing_textstylegetshadowcount) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the size of a text shadow container.| 672| void [OH_Drawing_TextStyleAddShadow](#oh_drawing_textstyleaddshadow) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const [OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Adds a shadow to a text shadow container.| 673| void [OH_Drawing_TextStyleClearShadows](#oh_drawing_textstyleclearshadows) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Clears all shadows in a text shadow container.| 674| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_TextStyleGetShadowWithIndex](#oh_drawing_textstylegetshadowwithindex) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Obtains a shadow with a given index in a text shadow container.| 675| void [OH_Drawing_TypographySetIndents](#oh_drawing_typographysetindents) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, const float indents[]) | Sets indents for typography. If this function is not called, texts will have no indentation applied.| 676| float [OH_Drawing_TypographyGetIndentsWithIndex](#oh_drawing_typographygetindentswithindex) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains indents with a given index.| 677| [OH_Drawing_Range](#oh_drawing_range) \* [OH_Drawing_TypographyGetLineTextRange](#oh_drawing_typographygetlinetextrange) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, bool) | Obtains the line bounds.| 678| void [OH_Drawing_DestroyTextShadows](#oh_drawing_destroytextshadows) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Reclaims the memory occupied by the vector consisting of the **OH_Drawing_TextShadow** objects.| 679| [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) \* [OH_Drawing_GetSystemFontConfigInfo](#oh_drawing_getsystemfontconfiginfo) ([OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode) \*) | Obtains the system font configuration.| 680| void [OH_Drawing_DestroySystemFontConfigInfo](#oh_drawing_destroysystemfontconfiginfo) ([OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) \*) | Reclaims the memory occupied by the system font configuration.| 681| void [OH_Drawing_SetTextStyleFontStyleStruct](#oh_drawing_settextstylefontstylestruct) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*drawingTextStyle, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyle) | Sets the font style, including the font weight, width, and slant, for a text style.| 682| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_TextStyleGetFontStyleStruct](#oh_drawing_textstylegetfontstylestruct) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*drawingTextStyle) | Obtains the font style, including the font weight, width, and slant, of a text style.| 683| void [OH_Drawing_SetTypographyStyleFontStyleStruct](#oh_drawing_settypographystylefontstylestruct) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*drawingStyle, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyle) | Sets the font style, including the font weight, width, and slant, for a typography style.| 684| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_TypographyStyleGetFontStyleStruct](#oh_drawing_typographystylegetfontstylestruct) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*drawingStyle) | Obtains the font style, including the font weight, width, and slant, of a typography style.| 685| void [OH_Drawing_TextStyleSetBackgroundRect](#oh_drawing_textstylesetbackgroundrect) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) \*, int styleId) | Sets a background rectangle and style ID for a text style. The style ID is valid only when the background box is a rounded rectangle.| 686| void [OH_Drawing_TypographyHandlerAddSymbol](#oh_drawing_typographyhandleraddsymbol) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, uint32_t symbol) | Adds the symbol to use in the typography creation process.| 687| void [OH_Drawing_TextStyleAddFontFeature](#oh_drawing_textstyleaddfontfeature) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*tag, int value) | Adds a font feature for a text style.| 688| void [OH_Drawing_TextStyleAddFontVariation](#oh_drawing_textstyleaddfontvariation) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*, const float) | Adds a font variation. This function takes effect only when the corresponding font file (.ttf file) supports variable adjustment. Otherwise, calling this function does not take effect.| 689| [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) \* [OH_Drawing_TextStyleGetFontFeatures](#oh_drawing_textstylegetfontfeatures) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains all the contents in a font feature map container.| 690| void [OH_Drawing_TextStyleDestroyFontFeatures](#oh_drawing_textstyledestroyfontfeatures) ([OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) \*, size_t fontFeatureSize) | Reclaims the memory occupied by the struct array that holds all the font features.| 691| size_t [OH_Drawing_TextStyleGetFontFeatureSize](#oh_drawing_textstylegetfontfeaturesize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the size of a font feature map container.| 692| void [OH_Drawing_TextStyleClearFontFeature](#oh_drawing_textstyleclearfontfeature) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Clears all the contents in a font feature map container.| 693| double [OH_Drawing_TextStyleGetBaselineShift](#oh_drawing_textstylegetbaselineshift) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the baseline drift of a text style.| 694| void [OH_Drawing_TextStyleSetBaselineShift](#oh_drawing_textstylesetbaselineshift) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double lineShift) | Sets a baseline drift for a text style.| 695| void [OH_Drawing_TypographyTextSetHeightBehavior](#oh_drawing_typographytextsetheightbehavior) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) heightMode) | Sets a text height modifier pattern.| 696| [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) [OH_Drawing_TypographyTextGetHeightBehavior](#oh_drawing_typographytextgetheightbehavior) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text height modifier pattern.| 697| [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \* [OH_Drawing_TypographyGetLineFontMetrics](#oh_drawing_typographygetlinefontmetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t lineNumber, size_t \*fontMetricsSize) | Obtains all font metrics from a given line.| 698| void [OH_Drawing_TypographyDestroyLineFontMetrics](#oh_drawing_typographydestroylinefontmetrics) ([OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Reclaims the memory occupied by the struct array that holds all the font metrics of a given line.| 699| bool [OH_Drawing_TextStyleIsEqual](#oh_drawing_textstyleisequal) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle) | Checks whether two text styles are equal.| 700| bool [OH_Drawing_TextStyleIsEqualByFont](#oh_drawing_textstyleisequalbyfont) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle) | Checks whether the font style properties of two text styles are equal.| 701| bool [OH_Drawing_TextStyleIsAttributeMatched](#oh_drawing_textstyleisattributematched) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle, [OH_Drawing_TextStyleType](#oh_drawing_textstyletype) textStyleType) | Checks whether two text styles have the same text style type.| 702| void [OH_Drawing_TextStyleSetPlaceholder](#oh_drawing_textstylesetplaceholder) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style) | Sets a placeholder for a text style.| 703| bool [OH_Drawing_TextStyleIsPlaceholder](#oh_drawing_textstyleisplaceholder) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style) | Checks whether a placeholder is set for a text style.| 704| [OH_Drawing_TextAlign](#oh_drawing_textalign) [OH_Drawing_TypographyStyleGetEffectiveAlignment](#oh_drawing_typographystylegeteffectivealignment) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the text alignment mode.| 705| bool [OH_Drawing_TypographyStyleIsHintEnabled](#oh_drawing_typographystyleishintenabled) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether font hinting is enabled for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.| 706| void [OH_Drawing_SetTypographyStyleTextStrutStyle](#oh_drawing_settypographystyletextstrutstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*) | Sets the strut style for a typography style.| 707| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \* [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the strut style of a typography style.| 708| void [OH_Drawing_TypographyStyleDestroyStrutStyle](#oh_drawing_typographystyledestroystrutstyle) ([OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*) | Reclaims the memory occupied by a strut style.| 709| bool [OH_Drawing_TypographyStyleStrutStyleEquals](#oh_drawing_typographystylestrutstyleequals) ([OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*from, [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*to) | Checks whether two strut styles are equal.| 710| void [OH_Drawing_TypographyStyleSetHintsEnabled](#oh_drawing_typographystylesethintsenabled) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, bool hintsEnabled) | Sets whether to enable font hinting for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.| 711| void [OH_Drawing_TypographyMarkDirty](#oh_drawing_typographymarkdirty) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Marks a typography object as dirty data. This function is used to initialize the typography state.| 712| int32_t [OH_Drawing_TypographyGetUnresolvedGlyphsCount](#oh_drawing_typographygetunresolvedglyphscount) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the number of unresolved glyphs in a typography object.| 713| void [OH_Drawing_TypographyUpdateFontSize](#oh_drawing_typographyupdatefontsize) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t from, size_t to, float fontSize) | Updates the font size in a typography object.| 714| bool [OH_Drawing_TypographyTextGetLineStyle](#oh_drawing_typographytextgetlinestyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether the text line style is enabled for a typography style.| 715| [OH_Drawing_FontWeight](#oh_drawing_fontweight) [OH_Drawing_TypographyTextlineStyleGetFontWeight](#oh_drawing_typographytextlinestylegetfontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font weight of a text line style.| 716| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) [OH_Drawing_TypographyTextlineStyleGetFontStyle](#oh_drawing_typographytextlinestylegetfontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font style of a text line style.| 717| char \*\* [OH_Drawing_TypographyTextlineStyleGetFontFamilies](#oh_drawing_typographytextlinestylegetfontfamilies) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font families of a text line style.| 718| void [OH_Drawing_TypographyTextlineStyleDestroyFontFamilies](#oh_drawing_typographytextlinestyledestroyfontfamilies) (char \*\*fontFamilies, size_t fontFamiliesNum) | Reclaims the memory occupied by the font families.| 719| double [OH_Drawing_TypographyTextlineStyleGetFontSize](#oh_drawing_typographytextlinestylegetfontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font size of a text line style.| 720| double [OH_Drawing_TypographyTextlineStyleGetHeightScale](#oh_drawing_typographytextlinestylegetheightscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the height scale factor of a text line style.| 721| bool [OH_Drawing_TypographyTextlineStyleGetHeightOnly](#oh_drawing_typographytextlinestylegetheightonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether only the font height is used for a text line style.| 722| bool [OH_Drawing_TypographyTextlineStyleGetHalfLeading](#oh_drawing_typographytextlinestylegethalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether half leading is enabled for a text line style.| 723| double [OH_Drawing_TypographyTextlineStyleGetSpacingScale](#oh_drawing_typographytextlinestylegetspacingscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the spacing scale factor of a text line style.| 724| bool [OH_Drawing_TypographyTextlineGetStyleOnly](#oh_drawing_typographytextlinegetstyleonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether only the text line style is enabled for a typography style.| 725| [OH_Drawing_TextAlign](#oh_drawing_textalign) [OH_Drawing_TypographyGetTextAlign](#oh_drawing_typographygettextalign) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text alignment mode.| 726| [OH_Drawing_TextDirection](#oh_drawing_textdirection) [OH_Drawing_TypographyGetTextDirection](#oh_drawing_typographygettextdirection) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text direction.| 727| size_t [OH_Drawing_TypographyGetTextMaxLines](#oh_drawing_typographygettextmaxlines) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the maximum number of lines.| 728| char \* [OH_Drawing_TypographyGetTextEllipsis](#oh_drawing_typographygettextellipsis) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text ellipsis content.| 729| void [OH_Drawing_TypographyDestroyEllipsis](#oh_drawing_typographydestroyellipsis) (char \*ellipsis) | Reclaims the memory occupied by the text ellipsis names.| 730| bool [OH_Drawing_TypographyStyleEquals](#oh_drawing_typographystyleequals) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*from, [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*to) | Checks whether two typography styles are the same.| 731| uint32_t [OH_Drawing_TextStyleGetColor](#oh_drawing_textstylegetcolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the color of a text style.| 732| [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle) [OH_Drawing_TextStyleGetDecorationStyle](#oh_drawing_textstylegetdecorationstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the decoration style of a text style.| 733| [OH_Drawing_FontWeight](#oh_drawing_fontweight) [OH_Drawing_TextStyleGetFontWeight](#oh_drawing_textstylegetfontweight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font weight of a text style.| 734| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) [OH_Drawing_TextStyleGetFontStyle](#oh_drawing_textstylegetfontstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font style of a text style.| 735| [OH_Drawing_TextBaseline](#oh_drawing_textbaseline) [OH_Drawing_TextStyleGetBaseline](#oh_drawing_textstylegetbaseline) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the baseline of a text style.| 736| char \*\* [OH_Drawing_TextStyleGetFontFamilies](#oh_drawing_textstylegetfontfamilies) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, size_t \*num) | Obtains the font families of a text style.| 737| void [OH_Drawing_TextStyleDestroyFontFamilies](#oh_drawing_textstyledestroyfontfamilies) (char \*\*fontFamilies, size_t num) | Reclaims the memory occupied by the font families.| 738| double [OH_Drawing_TextStyleGetFontSize](#oh_drawing_textstylegetfontsize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font size of a text style.| 739| double [OH_Drawing_TextStyleGetLetterSpacing](#oh_drawing_textstylegetletterspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the letter spacing of a text style.| 740| double [OH_Drawing_TextStyleGetWordSpacing](#oh_drawing_textstylegetwordspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the word spacing of a text style.| 741| double [OH_Drawing_TextStyleGetFontHeight](#oh_drawing_textstylegetfontheight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font height of a text style.| 742| bool [OH_Drawing_TextStyleGetHalfLeading](#oh_drawing_textstylegethalfleading) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Checks whether half leading is enabled for a text style.| 743| const char \* [OH_Drawing_TextStyleGetLocale](#oh_drawing_textstylegetlocale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the locale of a text style.| 744| void [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*) | Releases the memory occupied by a text box.| 745| void [OH_Drawing_SetTextShadow](#oh_drawing_settextshadow) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*shadow, uint32_t color, [OH_Drawing_Point](#oh_drawing_point) \*offset, double blurRadius) | Sets a text shadow.| 746| size_t [OH_Drawing_GetDrawingArraySize](#oh_drawing_getdrawingarraysize) ([OH_Drawing_Array](#oh_drawing_array) \*drawingArray) | Obtains the number of objects in an [OH_Drawing_Array](#oh_drawing_array).| 747| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateDefault](#oh_drawing_typefacecreatedefault) (void) | Creates a default **OH_Drawing_Typeface** object.| 748| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile) (const char \*path, int index) | Creates an **OH_Drawing_Typeface** object through a file.| 749| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromFileWithArguments](#oh_drawing_typefacecreatefromfilewitharguments) (const char \*path, const [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Creates an **OH_Drawing_Typeface** object with font arguments through a file. If the **OH_Drawing_Typeface** object does not support the variation described in the font arguments, this function creates an **OH_Drawing_Typeface** object with the default font arguments. In this case, this function provides the same capability as [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile).| 750| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromCurrent](#oh_drawing_typefacecreatefromcurrent) (const [OH_Drawing_Typeface](#oh_drawing_typeface) \*current, const [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Creates an **OH_Drawing_Typeface** object with font arguments based on an existing **OH_Drawing_Typeface** object.| 751| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromStream](#oh_drawing_typefacecreatefromstream) ([OH_Drawing_MemoryStream](#oh_drawing_memorystream) \*, int32_t index) | Creates an **OH_Drawing_Typeface** object through a memory stream. If the memory stream is an invalid font file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot release it.| 752| void [OH_Drawing_TypefaceDestroy](#oh_drawing_typefacedestroy) ([OH_Drawing_Typeface](#oh_drawing_typeface) \*) | Destroys an **OH_Drawing_Typeface** object and reclaims the memory occupied by the object.| 753| [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \* [OH_Drawing_FontArgumentsCreate](#oh_drawing_fontargumentscreate) (void) | Creates an **OH_Drawing_FontArguments** object. The font arguments are used to create an **OH_Drawing_Typeface** object with custom attributes.| 754| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontArgumentsAddVariation](#oh_drawing_fontargumentsaddvariation) ([OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments, const char \*axis, float value) | Adds a variation to an **OH_Drawing_FontArguments** object.| 755| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontArgumentsDestroy](#oh_drawing_fontargumentsdestroy) ([OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Destroys an **OH_Drawing_FontArguments** object.| 756| enum [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) { SHADOW_FLAGS_NONE, SHADOW_FLAGS_TRANSPARENT_OCCLUDER, SHADOW_FLAGS_GEOMETRIC_ONLY, SHADOW_FLAGS_ALL } | Defines an enum for the shadow flags.| 757| typedef enum [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) | Defines an enum for the shadow flags.| 758| void [OH_Drawing_CanvasClipRect](#oh_drawing_canvascliprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a rectangle.| 759| void [OH_Drawing_CanvasClipRoundRect](#oh_drawing_canvascliproundrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a rounded rectangle.| 760| void [OH_Drawing_CanvasClipPath](#oh_drawing_canvasclippath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a path.| 761| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasClipRegion](#oh_drawing_canvasclipregion) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Region](#oh_drawing_region) \*region, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp) | Clips a rectangle.| 762| void [OH_Drawing_CanvasRotate](#oh_drawing_canvasrotate) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float degrees, float px, float py) | Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation.| 763| void [OH_Drawing_CanvasTranslate](#oh_drawing_canvastranslate) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float dx, float dy) | Translates a canvas by a given distance.| 764| void [OH_Drawing_CanvasScale](#oh_drawing_canvasscale) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float sx, float sy) | Scales a canvas.| 765| void [OH_Drawing_CanvasSkew](#oh_drawing_canvasskew) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float sx, float sy) | Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and applies the resulting matrix to the canvas. The skew transformation matrix is as follows: \|1 sx 0\| \|sy 1 0\| \|0 0 1\| | 766| void [OH_Drawing_CanvasClear](#oh_drawing_canvasclear) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, uint32_t color) | Clears a canvas by using a given color.| 767| int32_t [OH_Drawing_CanvasGetWidth](#oh_drawing_canvasgetwidth) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the canvas width.| 768| int32_t [OH_Drawing_CanvasGetHeight](#oh_drawing_canvasgetheight) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the canvas height.| 769| void [OH_Drawing_CanvasGetLocalClipBounds](#oh_drawing_canvasgetlocalclipbounds) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the bounds of the cropping region of a canvas. This function cannot be used for recorded canvases.| 770| void [OH_Drawing_CanvasGetTotalMatrix](#oh_drawing_canvasgettotalmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Obtains the 3x3 matrix of a canvas.| 771| void [OH_Drawing_CanvasConcatMatrix](#oh_drawing_canvasconcatmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Preconcats the existing matrix with the passed-in matrix. The drawing operation triggered before this function is called is not affected.| 772| void [OH_Drawing_CanvasDrawShadow](#oh_drawing_canvasdrawshadow) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) planeParams, [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) flag) | Draws a spot shadow and uses a given path to outline the ambient shadow.| 773| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*recordCmd) | Draws a recording command object.| 774 775## Type Description 776 777 778### OH_Drawing_Array 779 780``` 781typedef struct OH_Drawing_Array OH_Drawing_Array 782``` 783 784**Description** 785 786Defines a struct for an array object, which is used to store multiple objects of the same type. 787 788**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 789 790**Since**: 14 791 792### OH_Drawing_String 793 794``` 795typedef struct OH_Drawing_String OH_Drawing_String 796``` 797 798**Description** 799 800Defines a struct for a string of characters encoded in UTF-16. 801 802**Since**: 14 803 804 805### OH_Drawing_SystemFontType 806 807``` 808typedef enum OH_Drawing_SystemFontType OH_Drawing_SystemFontType 809``` 810 811**Description** 812 813Defines an enum for the system font types. 814 815**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 816 817**Since**: 14 818 819 820### OH_Drawing_FontArguments 821 822``` 823typedef struct OH_Drawing_FontArguments OH_Drawing_FontArguments 824``` 825 826**Description** 827 828Defines a struct for font arguments. 829 830**Since**: 13 831 832### OH_Drawing_RecordCmd 833 834``` 835typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd 836``` 837 838**Description** 839 840Defines the recording command class, which is used to store the set of recording commands. 841 842**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 843 844**Since**: 13 845 846 847### OH_Drawing_RecordCmdUtils 848 849``` 850typedef struct OH_Drawing_RecordCmdUtils OH_Drawing_RecordCmdUtils 851``` 852 853**Description** 854 855Defines the recording command tool, which is used to generate recording commands. 856 857**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 858 859**Since**: 13 860 861 862### OH_Drawing_ErrorCode 863 864``` 865typedef enum OH_Drawing_ErrorCode OH_Drawing_ErrorCode 866``` 867 868 869**Description** 870 871Defines an enum for the error codes that may be generated by the module. 872 873**Since**: 12 874 875 876### OH_Drawing_PathOpMode 877 878``` 879typedef enum OH_Drawing_PathOpMode OH_Drawing_PathOpMode 880``` 881 882**Description** 883 884Defines an enum for the operation modes available for a path. 885 886**Since**: 12 887 888 889### OH_Drawing_PathMeasureMatrixFlags 890 891``` 892typedef enum OH_Drawing_PathMeasureMatrixFlags OH_Drawing_PathMeasureMatrixFlags 893``` 894 895**Description** 896 897Defines an enum for the types of matrix information obtained during path measurement. 898 899**Since**: 12 900 901 902### OH_Drawing_RegionOpMode 903 904``` 905typedef enum OH_Drawing_RegionOpMode OH_Drawing_RegionOpMode 906``` 907 908**Description** 909 910Defines an enum for the operation modes available for a region. 911 912**Since**: 12 913 914 915### OH_Drawing_ImageFilter 916 917``` 918typedef struct OH_Drawing_ImageFilter OH_Drawing_ImageFilter 919``` 920 921**Description** 922 923Defines a struct for an image filter, which is used to operate all color bits that make up image pixels. 924 925**Since**: 12 926 927 928### OH_Drawing_Filter 929 930``` 931typedef struct OH_Drawing_Filter OH_Drawing_Filter 932``` 933 934**Description** 935 936Defines a struct for a filter, which consists of a color filter, mask filter, and image filter. 937 938**Since**: 11 939 940### OH_Drawing_AlphaFormat 941 942``` 943typedef enum OH_Drawing_AlphaFormat OH_Drawing_AlphaFormat 944``` 945 946**Description** 947 948Defines an enum for the alpha formats of bitmap pixels. 949 950**Since**: 8 951 952 953### OH_Drawing_Bitmap 954 955``` 956typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap 957``` 958 959**Description** 960 961Defines a struct for a bitmap, which is a memory area that contains the pixel data of a shape. 962 963**Since**: 8 964 965 966### OH_Drawing_BitmapFormat 967 968``` 969typedef struct OH_Drawing_BitmapFormat OH_Drawing_BitmapFormat 970``` 971 972**Description** 973 974Defines a struct for the pixel format of a bitmap, including the color type and alpha type. 975 976**Since**: 8 977 978 979### OH_Drawing_BlendMode 980 981``` 982typedef enum OH_Drawing_BlendMode OH_Drawing_BlendMode 983``` 984 985**Description** 986 987Defines an enum for the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same on the four channels (red, green, blue, and alpha). The operations for the alpha channel are used as examples. 988 989For brevity, the following abbreviations are used: 990 991**s**: source. 992 993**d**: destination. 994 995**sa**: source alpha. 996 997**da**: destination alpha. 998 999The following abbreviations are used in the calculation result: 1000 1001**r**: The calculation methods of the four channels are the same. 1002 1003**ra**: Only the alpha channel is manipulated. 1004 1005**rc**: The other three color channels are manipulated. 1006 1007**Since**: 11 1008 1009 1010### OH_Drawing_BlurType 1011 1012``` 1013typedef enum OH_Drawing_BlurType OH_Drawing_BlurType 1014``` 1015 1016**Description** 1017 1018Defines an enum for the blur types. 1019 1020**Since**: 11 1021 1022 1023### OH_Drawing_BreakStrategy 1024 1025``` 1026typedef enum OH_Drawing_BreakStrategy OH_Drawing_BreakStrategy 1027``` 1028 1029**Description** 1030 1031Defines an enum for the text break strategies. 1032 1033**Since**: 11 1034 1035 1036### OH_Drawing_Brush 1037 1038``` 1039typedef struct OH_Drawing_Brush OH_Drawing_Brush 1040``` 1041 1042**Description** 1043 1044Defines a struct for a brush, which is used to describe the style and color to fill in a shape. 1045 1046**Since**: 8 1047 1048 1049### OH_Drawing_Canvas 1050 1051``` 1052typedef struct OH_Drawing_Canvas OH_Drawing_Canvas 1053``` 1054 1055**Description** 1056 1057Defines a struct for a rectangular canvas, on which various shapes, images, and texts can be drawn by using the brush and pen. 1058 1059**Since**: 8 1060 1061 1062### OH_Drawing_CanvasClipOp 1063 1064``` 1065typedef enum OH_Drawing_CanvasClipOp OH_Drawing_CanvasClipOp 1066``` 1067 1068**Description** 1069 1070Defines an enum for the canvas clipping modes. 1071 1072**Since**: 11 1073 1074 1075### OH_Drawing_CanvasShadowFlags 1076 1077``` 1078typedef enum OH_Drawing_CanvasShadowFlags OH_Drawing_CanvasShadowFlags 1079``` 1080 1081**Description** 1082 1083Defines an enum for the shadow flags. 1084 1085**Since**: 12 1086 1087 1088### OH_Drawing_ColorFilter 1089 1090``` 1091typedef struct OH_Drawing_ColorFilter OH_Drawing_ColorFilter 1092``` 1093 1094**Description** 1095 1096Defines a struct for a color filter, which is used to convert a color into a new one. 1097 1098**Since**: 11 1099 1100 1101### OH_Drawing_ColorFormat 1102 1103``` 1104typedef enum OH_Drawing_ColorFormat OH_Drawing_ColorFormat 1105``` 1106 1107**Description** 1108 1109Defines an enum for the storage formats of bitmap pixels. 1110 1111**Since**: 8 1112 1113 1114### OH_Drawing_ColorSpace 1115 1116``` 1117typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace 1118``` 1119 1120**Description** 1121 1122Defines a struct for a color space, which is used to describe the color information. 1123 1124**Since**: 12 1125 1126 1127### OH_Drawing_Corner_Radii 1128 1129``` 1130typedef OH_Drawing_Point2D OH_Drawing_Corner_Radii 1131``` 1132 1133**Description** 1134 1135Defines a struct for the radii of a rounded corner. The radii consist of the radius in the x-axis direction and that in the y-axis direction. 1136 1137**Since**: 12 1138 1139 1140### OH_Drawing_CornerPos 1141 1142``` 1143typedef enum OH_Drawing_CornerPos OH_Drawing_CornerPos 1144``` 1145 1146**Description** 1147 1148Defines an enum for the corner positions of a rounded rectangle. 1149 1150**Since**: 12 1151 1152 1153### OH_Drawing_EllipsisModal 1154 1155``` 1156typedef enum OH_Drawing_EllipsisModal OH_Drawing_EllipsisModal 1157``` 1158 1159**Description** 1160 1161Defines an enum for the text ellipsis styles. 1162 1163**Since**: 11 1164 1165 1166### OH_Drawing_FilterMode 1167 1168``` 1169typedef enum OH_Drawing_FilterMode OH_Drawing_FilterMode 1170``` 1171 1172**Description** 1173 1174Defines an enum for the filter modes. 1175 1176**Since**: 12 1177 1178 1179### OH_Drawing_Font 1180 1181``` 1182typedef struct OH_Drawing_Font OH_Drawing_Font 1183``` 1184 1185**Description** 1186 1187Defines a struct for a font. 1188 1189**Since**: 11 1190 1191 1192### OH_Drawing_Font_Metrics 1193 1194``` 1195typedef struct OH_Drawing_Font_Metrics OH_Drawing_Font_Metrics 1196``` 1197 1198**Description** 1199 1200Defines a struct for the measurement information about a font. 1201 1202**Since**: 12 1203 1204 1205### OH_Drawing_FontAdjustInfo 1206 1207``` 1208typedef struct OH_Drawing_FontAdjustInfo OH_Drawing_FontAdjustInfo 1209``` 1210 1211**Description** 1212 1213Defines a struct for the information about a font weight mapping. 1214 1215**Since**: 12 1216 1217 1218### OH_Drawing_FontAliasInfo 1219 1220``` 1221typedef struct OH_Drawing_FontAliasInfo OH_Drawing_FontAliasInfo 1222``` 1223 1224**Description** 1225 1226Defines a struct for the information about a font alias. 1227 1228**Since**: 12 1229 1230 1231### OH_Drawing_FontCollection 1232 1233``` 1234typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection 1235``` 1236 1237**Description** 1238 1239Defines a struct used to load fonts. 1240 1241**Since**: 8 1242 1243 1244### OH_Drawing_FontConfigInfo 1245 1246``` 1247typedef struct OH_Drawing_FontConfigInfo OH_Drawing_FontConfigInfo 1248``` 1249 1250**Description** 1251 1252Defines a struct for the information about a system font configuration. 1253 1254**Since**: 12 1255 1256 1257### OH_Drawing_FontDescriptor 1258 1259``` 1260typedef struct OH_Drawing_FontDescriptor OH_Drawing_FontDescriptor 1261``` 1262 1263**Description** 1264 1265Defines a struct for the detailed information about a system font. 1266 1267**Since**: 12 1268 1269 1270### OH_Drawing_FontEdging 1271 1272``` 1273typedef enum OH_Drawing_FontEdging OH_Drawing_FontEdging 1274``` 1275 1276**Description** 1277 1278Defines an enum for the font edging types. 1279 1280**Since**: 12 1281 1282 1283### OH_Drawing_FontFallbackGroup 1284 1285``` 1286typedef struct OH_Drawing_FontFallbackGroup OH_Drawing_FontFallbackGroup 1287``` 1288 1289**Description** 1290 1291Defines a struct for the information about a font fallback group. 1292 1293**Since**: 12 1294 1295 1296### OH_Drawing_FontFallbackInfo 1297 1298``` 1299typedef struct OH_Drawing_FontFallbackInfo OH_Drawing_FontFallbackInfo 1300``` 1301 1302**Description** 1303 1304Defines a struct for the information about a font fallback. 1305 1306**Since**: 12 1307 1308 1309### OH_Drawing_FontGenericInfo 1310 1311``` 1312typedef struct OH_Drawing_FontGenericInfo OH_Drawing_FontGenericInfo 1313``` 1314 1315**Description** 1316 1317Defines a struct for the information about generic fonts supported by the system. 1318 1319**Since**: 12 1320 1321 1322### OH_Drawing_FontHinting 1323 1324``` 1325typedef enum OH_Drawing_FontHinting OH_Drawing_FontHinting 1326``` 1327 1328**Description** 1329 1330Defines an enum for the font hinting types. 1331 1332**Since**: 12 1333 1334 1335### OH_Drawing_FontMgr 1336 1337``` 1338typedef struct OH_Drawing_FontMgr OH_Drawing_FontMgr 1339``` 1340 1341**Description** 1342 1343Defines a struct for the font manager, which is used for font management. 1344 1345**Since**: 12 1346 1347 1348### OH_Drawing_FontParser 1349 1350``` 1351typedef struct OH_Drawing_FontParser OH_Drawing_FontParser 1352``` 1353 1354**Description** 1355 1356Defines a struct used to parse system font files. 1357 1358**Since**: 12 1359 1360 1361### OH_Drawing_FontStyleSet 1362 1363``` 1364typedef struct OH_Drawing_FontStyleSet OH_Drawing_FontStyleSet 1365``` 1366 1367**Description** 1368 1369Defines a struct for a font style set, which is used for font style family matching. 1370 1371**Since**: 12 1372 1373 1374### OH_Drawing_FontStyleStruct 1375 1376``` 1377typedef struct OH_Drawing_FontStyleStruct OH_Drawing_FontStyleStruct 1378``` 1379 1380**Description** 1381 1382Defines a struct for a font style. 1383 1384**Since**: 12 1385 1386 1387### OH_Drawing_GpuContext 1388 1389``` 1390typedef struct OH_Drawing_GpuContext OH_Drawing_GpuContext 1391``` 1392 1393**Description** 1394 1395Defines a struct for the GPU context, which is used to describe the GPU backend context. 1396 1397**Since**: 12 1398 1399 1400### OH_Drawing_GpuContextOptions 1401 1402``` 1403typedef struct OH_Drawing_GpuContextOptions OH_Drawing_GpuContextOptions 1404``` 1405 1406**Description** 1407 1408Defines a struct for the options about the GPU context. 1409 1410**Since**: 12 1411 1412 1413### OH_Drawing_Image 1414 1415``` 1416typedef struct OH_Drawing_Image OH_Drawing_Image 1417``` 1418 1419**Description** 1420 1421Defines a struct for an image that describes a two-dimensional pixel array. 1422 1423**Since**: 12 1424 1425 1426### OH_Drawing_Image_Info 1427 1428``` 1429typedef struct OH_Drawing_Image_Info OH_Drawing_Image_Info 1430``` 1431 1432**Description** 1433 1434Defines a struct for the image information. 1435 1436**Since**: 12 1437 1438 1439### OH_Drawing_LineMetrics 1440 1441``` 1442typedef struct OH_Drawing_LineMetrics OH_Drawing_LineMetrics 1443``` 1444 1445**Description** 1446 1447Defines a struct for the measurement information about a line of text. 1448 1449**Since**: 12 1450 1451 1452### OH_Drawing_MaskFilter 1453 1454``` 1455typedef struct OH_Drawing_MaskFilter OH_Drawing_MaskFilter 1456``` 1457 1458**Description** 1459 1460Defines a struct for a mask filter, which is used to convert a mask into a new one. 1461 1462**Since**: 11 1463 1464 1465### OH_Drawing_Matrix 1466 1467``` 1468typedef struct OH_Drawing_Matrix OH_Drawing_Matrix 1469``` 1470 1471**Description** 1472 1473Defines a struct for a matrix, which is used to describe coordinate transformation. 1474 1475**Since**: 11 1476 1477 1478### OH_Drawing_MemoryStream 1479 1480``` 1481typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream 1482``` 1483 1484**Description** 1485 1486Defines a struct for a memory stream. 1487 1488**Since**: 12 1489 1490 1491### OH_Drawing_MipmapMode 1492 1493``` 1494typedef enum OH_Drawing_MipmapMode OH_Drawing_MipmapMode 1495``` 1496 1497**Description** 1498 1499Defines an enum for the mipmap modes. 1500 1501**Since**: 12 1502 1503 1504### OH_Drawing_Path 1505 1506``` 1507typedef struct OH_Drawing_Path OH_Drawing_Path 1508``` 1509 1510**Description** 1511 1512Defines a struct for a path, which is used to customize various shapes. 1513 1514**Since**: 8 1515 1516 1517### OH_Drawing_PathAddMode 1518 1519``` 1520typedef enum OH_Drawing_PathAddMode OH_Drawing_PathAddMode 1521``` 1522 1523**Description** 1524 1525Defines an enum for the path adding modes. 1526 1527**Since**: 12 1528 1529 1530### OH_Drawing_PathDirection 1531 1532``` 1533typedef enum OH_Drawing_PathDirection OH_Drawing_PathDirection 1534``` 1535 1536**Description** 1537 1538Defines an enum for the directions of a closed contour. 1539 1540**Since**: 12 1541 1542 1543### OH_Drawing_PathEffect 1544 1545``` 1546typedef struct OH_Drawing_PathEffect OH_Drawing_PathEffect 1547``` 1548 1549**Description** 1550 1551Defines a struct for a path effect that affects the stroke. 1552 1553**Since**: 12 1554 1555 1556### OH_Drawing_PathFillType 1557 1558``` 1559typedef enum OH_Drawing_PathFillType OH_Drawing_PathFillType 1560``` 1561 1562**Description** 1563 1564Defines an enum for the fill types of a path. 1565 1566**Since**: 12 1567 1568 1569### OH_Drawing_Pen 1570 1571``` 1572typedef struct OH_Drawing_Pen OH_Drawing_Pen 1573``` 1574 1575**Description** 1576 1577Defines a struct for a pen, which is used to describe the style and color to outline a shape. 1578 1579**Since**: 8 1580 1581 1582### OH_Drawing_PenLineCapStyle 1583 1584``` 1585typedef enum OH_Drawing_PenLineCapStyle OH_Drawing_PenLineCapStyle 1586``` 1587 1588**Description** 1589 1590Defines an enum for the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen. 1591 1592**Since**: 8 1593 1594 1595### OH_Drawing_PenLineJoinStyle 1596 1597``` 1598typedef enum OH_Drawing_PenLineJoinStyle OH_Drawing_PenLineJoinStyle 1599``` 1600 1601**Description** 1602 1603Defines an enum for the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen. 1604 1605**Since**: 8 1606 1607 1608### OH_Drawing_PixelMap 1609 1610``` 1611typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap 1612``` 1613 1614**Description** 1615 1616Defines a struct for a pixel map, which is used to wrap the real pixel map supported by the image framework. 1617 1618**Since**: 12 1619 1620 1621### OH_Drawing_PlaceholderSpan 1622 1623``` 1624typedef struct OH_Drawing_PlaceholderSpan OH_Drawing_PlaceholderSpan 1625``` 1626 1627**Description** 1628 1629Defines a struct for the placeholder that acts as a span. 1630 1631**Since**: 11 1632 1633 1634### OH_Drawing_PlaceholderVerticalAlignment 1635 1636``` 1637typedef enum OH_Drawing_PlaceholderVerticalAlignment OH_Drawing_PlaceholderVerticalAlignment 1638``` 1639 1640**Description** 1641 1642Defines an enum for the vertical alignment modes of placeholders. 1643 1644**Since**: 11 1645 1646 1647### OH_Drawing_Point 1648 1649``` 1650typedef struct OH_Drawing_Point OH_Drawing_Point 1651``` 1652 1653**Description** 1654 1655Defines a struct for a coordinate point. 1656 1657**Since**: 11 1658 1659 1660### OH_Drawing_Point2D 1661 1662``` 1663typedef struct OH_Drawing_Point2D OH_Drawing_Point2D 1664``` 1665 1666**Description** 1667 1668Defines a struct for a two-dimensional coordinate point. 1669 1670**Since**: 12 1671 1672 1673### OH_Drawing_Point3D 1674 1675``` 1676typedef struct OH_Drawing_Point3D OH_Drawing_Point3D 1677``` 1678 1679**Description** 1680 1681Defines a struct for a three-dimensional coordinate point. 1682 1683**Since**: 12 1684 1685 1686### OH_Drawing_PointMode 1687 1688``` 1689typedef enum OH_Drawing_PointMode OH_Drawing_PointMode 1690``` 1691 1692**Description** 1693 1694Defines an enum for the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons. 1695 1696**Since**: 12 1697 1698 1699### OH_Drawing_PositionAndAffinity 1700 1701``` 1702typedef struct OH_Drawing_PositionAndAffinity OH_Drawing_PositionAndAffinity 1703``` 1704 1705**Description** 1706 1707Defines a struct used to receive the position and affinity of a glyph. 1708 1709**Since**: 11 1710 1711 1712### OH_Drawing_Range 1713 1714``` 1715typedef struct OH_Drawing_Range OH_Drawing_Range 1716``` 1717 1718**Description** 1719 1720Defines a struct for a range, which is used to receive the start position and end position of a glyph. 1721 1722**Since**: 11 1723 1724 1725### OH_Drawing_Rect 1726 1727``` 1728typedef struct OH_Drawing_Rect OH_Drawing_Rect 1729``` 1730 1731**Description** 1732 1733Defines a struct for a rectangle. 1734 1735**Since**: 11 1736 1737 1738### OH_Drawing_RectHeightStyle 1739 1740``` 1741typedef enum OH_Drawing_RectHeightStyle OH_Drawing_RectHeightStyle 1742``` 1743 1744**Description** 1745 1746Defines an enum for the rectangle height styles. 1747 1748**Since**: 11 1749 1750 1751### OH_Drawing_RectStyle_Info 1752 1753``` 1754typedef struct OH_Drawing_RectStyle_Info OH_Drawing_RectStyle_Info 1755``` 1756 1757**Description** 1758 1759Defines a struct for the style of a rectangle. 1760 1761**Since**: 12 1762 1763 1764### OH_Drawing_RectWidthStyle 1765 1766``` 1767typedef enum OH_Drawing_RectWidthStyle OH_Drawing_RectWidthStyle 1768``` 1769 1770**Description** 1771 1772Defines an enum for the rectangle width styles. 1773 1774**Since**: 11 1775 1776 1777### OH_Drawing_Region 1778 1779``` 1780typedef struct OH_Drawing_Region OH_Drawing_Region 1781``` 1782 1783**Description** 1784 1785Defines a struct for a region, which represents a closed area on the canvas for more accurate graphic control. 1786 1787**Since**: 12 1788 1789 1790### OH_Drawing_RoundRect 1791 1792``` 1793typedef struct OH_Drawing_RoundRect OH_Drawing_RoundRect 1794``` 1795 1796**Description** 1797 1798Defines a struct for a rounded rectangle. 1799 1800**Since**: 11 1801 1802 1803### OH_Drawing_RunBuffer 1804 1805``` 1806typedef struct OH_Drawing_RunBuffer OH_Drawing_RunBuffer 1807``` 1808 1809**Description** 1810 1811Defines a struct for a run, which provides storage for glyphs and positions. 1812 1813**Since**: 11 1814 1815 1816### OH_Drawing_SamplingOptions 1817 1818``` 1819typedef struct OH_Drawing_SamplingOptions OH_Drawing_SamplingOptions 1820``` 1821 1822**Description** 1823 1824Defines a struct for sampling options, which describe the sampling methods for images and bitmaps. 1825 1826**Since**: 12 1827 1828 1829### OH_Drawing_ScaleToFit 1830 1831``` 1832typedef enum OH_Drawing_ScaleToFit OH_Drawing_ScaleToFit 1833``` 1834 1835**Description** 1836 1837Defines an enum for the matrix scaling modes. 1838 1839**Since**: 12 1840 1841 1842### OH_Drawing_ShaderEffect 1843 1844``` 1845typedef struct OH_Drawing_ShaderEffect OH_Drawing_ShaderEffect 1846``` 1847 1848**Description** 1849 1850Defines a struct for a shader effect, which is used to describe the source color of the drawn content. 1851 1852**Since**: 11 1853 1854 1855### OH_Drawing_ShadowLayer 1856 1857``` 1858typedef struct OH_Drawing_ShadowLayer OH_Drawing_ShadowLayer 1859``` 1860 1861**Description** 1862 1863Defines a struct for a shadow, which is used to describe the shadow layer of the drawn content. 1864 1865**Since**: 12 1866 1867 1868### OH_Drawing_SrcRectConstraint 1869 1870``` 1871typedef enum OH_Drawing_SrcRectConstraint OH_Drawing_SrcRectConstraint 1872``` 1873 1874**Description** 1875 1876Defines an enum for the constraint types of the source rectangle. 1877 1878**Since**: 12 1879 1880 1881### OH_Drawing_StrutStyle 1882 1883``` 1884typedef struct OH_Drawing_StrutStyle OH_Drawing_StrutStyle 1885``` 1886 1887**Description** 1888 1889Defines a struct for a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts. 1890 1891**Since**: 12 1892 1893 1894### OH_Drawing_Surface 1895 1896``` 1897typedef struct OH_Drawing_Surface OH_Drawing_Surface 1898``` 1899 1900**Description** 1901 1902Defines a struct for a surface, which is used to manage the content drawn on the canvas. 1903 1904**Since**: 12 1905 1906 1907### OH_Drawing_TextBlob 1908 1909``` 1910typedef struct OH_Drawing_TextBlob OH_Drawing_TextBlob 1911``` 1912 1913**Description** 1914 1915Defines a struct for a text blob, an immutable container that holds multiple texts. Each text blob consists of glyphs and position. 1916 1917**Since**: 11 1918 1919 1920### OH_Drawing_TextBlobBuilder 1921 1922``` 1923typedef struct OH_Drawing_TextBlobBuilder OH_Drawing_TextBlobBuilder 1924``` 1925 1926**Description** 1927 1928Defines a struct for a text blob builder, which is used to build a text blob. 1929 1930**Since**: 11 1931 1932 1933### OH_Drawing_TextBox 1934 1935``` 1936typedef struct OH_Drawing_TextBox OH_Drawing_TextBox 1937``` 1938 1939**Description** 1940 1941Defines a struct for a text box, which is used to receive the rectangle size, direction, and quantity. 1942 1943**Since**: 11 1944 1945 1946### OH_Drawing_TextDecorationStyle 1947 1948``` 1949typedef enum OH_Drawing_TextDecorationStyle OH_Drawing_TextDecorationStyle 1950``` 1951 1952**Description** 1953 1954Defines an enum for the text decoration styles. 1955 1956**Since**: 11 1957 1958 1959### OH_Drawing_TextEncoding 1960 1961``` 1962typedef enum OH_Drawing_TextEncoding OH_Drawing_TextEncoding 1963``` 1964 1965**Description** 1966 1967Defines an enum for the text encoding types. 1968 1969**Since**: 12 1970 1971 1972### OH_Drawing_TextShadow 1973 1974``` 1975typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow 1976``` 1977 1978**Description** 1979 1980Defines a struct used to manage text shadows. 1981 1982**Since**: 12 1983 1984 1985### OH_Drawing_TextStyle 1986 1987``` 1988typedef struct OH_Drawing_TextStyle OH_Drawing_TextStyle 1989``` 1990 1991**Description** 1992 1993Defines a struct used to manage text colors and decorations. 1994 1995**Since**: 8 1996 1997 1998### OH_Drawing_TileMode 1999 2000``` 2001typedef enum OH_Drawing_TileMode OH_Drawing_TileMode 2002``` 2003 2004**Description** 2005 2006Defines an enum for the tile modes of the shader effect. 2007 2008**Since**: 11 2009 2010 2011### OH_Drawing_Typeface 2012 2013``` 2014typedef struct OH_Drawing_Typeface OH_Drawing_Typeface 2015``` 2016 2017**Description** 2018 2019Defines a struct for a typeface. 2020 2021**Since**: 11 2022 2023 2024### OH_Drawing_Typography 2025 2026``` 2027typedef struct OH_Drawing_Typography OH_Drawing_Typography 2028``` 2029 2030**Description** 2031 2032Defines a struct used to manage the typography layout and display. 2033 2034**Since**: 8 2035 2036 2037### OH_Drawing_TypographyCreate 2038 2039``` 2040typedef struct OH_Drawing_TypographyCreate OH_Drawing_TypographyCreate 2041``` 2042 2043**Description** 2044 2045Defines a struct used to create an [OH_Drawing_Typography](#oh_drawing_typography) object. 2046 2047**Since**: 8 2048 2049 2050### OH_Drawing_TypographyStyle 2051 2052``` 2053typedef struct OH_Drawing_TypographyStyle OH_Drawing_TypographyStyle 2054``` 2055 2056**Description** 2057 2058Defines a struct used to manage the typography style, such as the text direction. 2059 2060**Since**: 8 2061 2062 2063### OH_Drawing_VertexMode 2064 2065``` 2066typedef enum OH_Drawing_VertexMode OH_Drawing_VertexMode 2067``` 2068 2069**Description** 2070 2071Defines an enum for the modes of interpreting the geometry of a given vertex. 2072 2073**Since**: 12 2074 2075 2076### OH_Drawing_WordBreakType 2077 2078``` 2079typedef enum OH_Drawing_WordBreakType OH_Drawing_WordBreakType 2080``` 2081 2082**Description** 2083 2084Defines an enum for the word break types. 2085 2086**Since**: 11 2087 2088 2089## Enum Description 2090 2091### OH_Drawing_SystemFontType 2092 2093``` 2094enum OH_Drawing_SystemFontType 2095``` 2096 2097**Description** 2098 2099Enumerates the system font types. 2100 2101**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 2102 2103**Since**: 14 2104 2105| Value| Description| 2106| -------- | -------- | 2107| ALL | All font types.| 2108| GENERIC | System font type.| 2109| STYLISH | Style font type.| 2110| INSTALLED | User-installed font type.| 2111 2112### OH_Drawing_ErrorCode 2113 2114``` 2115enum OH_Drawing_ErrorCode 2116``` 2117 2118**Description** 2119 2120Enumerates the error codes that may be generated by the module. 2121 2122**Since**: 12 2123 2124| Value| Description| 2125| -------- | -------- | 2126| OH_DRAWING_SUCCESS | Operation successful.| 2127| OH_DRAWING_ERROR_NO_PERMISSION | Permission verification fails.| 2128| OH_DRAWING_ERROR_INVALID_PARAMETER | Invalid input parameter. For example, NULL is passed in.| 2129| OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE | The input parameter is not in the valid range.| 2130| OH_DRAWING_ERROR_ALLOCATION_FAILED<sup>13+</sup> | Failed to allocate memory.| 2131 2132### OH_Drawing_PathMeasureMatrixFlags 2133 2134``` 2135enum OH_Drawing_PathMeasureMatrixFlags 2136``` 2137 2138**Description** 2139 2140Enumerates the types of matrix information obtained during path measurement. 2141 2142**Since**: 12 2143 2144| Value| Description| 2145| -------- | -------- | 2146| GET_POSITION_MATRIX | Obtains the matrix corresponding to the location information.| 2147| GET_TANGENT_MATRIX | Obtains the matrix corresponding to the tangent information.| 2148| GET_POSITION_AND_TANGENT_MATRIX | Obtains the matrix corresponding to the location and tangent information.| 2149 2150 2151### OH_Drawing_PathOpMode 2152 2153``` 2154enum OH_Drawing_PathOpMode 2155``` 2156 2157**Description** 2158 2159Enumerates the operation modes available for a path. 2160 2161**Since**: 12 2162 2163| Value| Description| 2164| -------- | -------- | 2165| PATH_OP_MODE_DIFFERENCE | Difference operation.| 2166| PATH_OP_MODE_INTERSECT | Intersection operation.| 2167| PATH_OP_MODE_UNION | Union operation.| 2168| PATH_OP_MODE_XOR | XOR operation.| 2169| PATH_OP_MODE_REVERSE_DIFFERENCE | Reverse difference operation.| 2170 2171 2172### OH_Drawing_RegionOpMode 2173 2174``` 2175enum OH_Drawing_RegionOpMode 2176``` 2177 2178**Description** 2179 2180Enumerates the operation modes available for a region. 2181 2182**Since**: 12 2183 2184| Value| Description| 2185| -------- | -------- | 2186| REGION_OP_MODE_DIFFERENCE | Difference operation.| 2187| REGION_OP_MODE_INTERSECT | Intersection operation.| 2188| REGION_OP_MODE_UNION | Union operation.| 2189| REGION_OP_MODE_XOR | XOR operation.| 2190| REGION_OP_MODE_REVERSE_DIFFERENCE | Reverse difference operation.| 2191| REGION_OP_MODE_REPLACE | Replacement operation.| 2192 2193 2194### OH_Drawing_AlphaFormat 2195 2196``` 2197enum OH_Drawing_AlphaFormat 2198``` 2199 2200**Description** 2201 2202Enumerates the alpha formats of bitmap pixels. 2203 2204**Since**: 8 2205 2206| Value| Description| 2207| -------- | -------- | 2208| ALPHA_FORMAT_UNKNOWN | Unknown format.| 2209| ALPHA_FORMAT_OPAQUE | The bitmap does not have the alpha component.| 2210| ALPHA_FORMAT_PREMUL | The color component of each pixel is premultiplied by the alpha component.| 2211| ALPHA_FORMAT_UNPREMUL | The color component of each pixel is not premultiplied by the alpha component.| 2212 2213 2214### OH_Drawing_BlendMode 2215 2216``` 2217enum OH_Drawing_BlendMode 2218``` 2219 2220**Description** 2221 2222Enumerates the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same on the four channels (red, green, blue, and alpha). The operations for the alpha channel are used as examples. 2223 2224For brevity, the following abbreviations are used: 2225 2226**s**: source. 2227 2228**d**: destination. 2229 2230**sa**: source alpha. 2231 2232**da**: destination alpha. 2233 2234The following abbreviations are used in the calculation result: 2235 2236**r**: The calculation methods of the four channels are the same. 2237 2238**ra**: Only the alpha channel is manipulated. 2239 2240**rc**: The other three color channels are manipulated. 2241 2242**Since**: 11 2243 2244| Value| Description| 2245| -------- | -------- | 2246| BLEND_MODE_CLEAR | Clear mode. r = 0.| 2247| BLEND_MODE_SRC | r = s (The four channels of **result** are equal to the four channels of **source**, that is, the result is equal to the source.)| 2248| BLEND_MODE_DST | r = d (The four channels of **result** are equal to the four channels of **destination**, that is, the result is equal to the destination.)| 2249| BLEND_MODE_SRC_OVER | r = s + (1 - sa) \* d. | 2250| BLEND_MODE_DST_OVER | r = d + (1 - da) \* s. | 2251| BLEND_MODE_SRC_IN | r = s \* da. | 2252| BLEND_MODE_DST_IN | r = d \* sa. | 2253| BLEND_MODE_SRC_OUT | r = s \* (1 - da). | 2254| BLEND_MODE_DST_OUT | r = d \* (1 - sa). | 2255| BLEND_MODE_SRC_ATOP | r = s \* da + d \* (1 - sa). | 2256| BLEND_MODE_DST_ATOP | r = d \* sa + s \* (1 - da). | 2257| BLEND_MODE_XOR | r = s \* (1 - da) + d \* (1 - sa). | 2258| BLEND_MODE_PLUS | r = min(s + d, 1). | 2259| BLEND_MODE_MODULATE | r = s \* d. | 2260| BLEND_MODE_SCREEN | Screen mode. r = s + d - s \* d| 2261| BLEND_MODE_OVERLAY | Overlay mode.| 2262| BLEND_MODE_DARKEN | Darken mode. rc = s + d - max(s \* da, d \* sa), ra = s + (1 - sa) \* d| 2263| BLEND_MODE_LIGHTEN | Lighten mode. rc = s + d - min(s \* da, d \* sa), ra = s + (1 - sa) \* d| 2264| BLEND_MODE_COLOR_DODGE | Color dodge mode.| 2265| BLEND_MODE_COLOR_BURN | Color burn mode.| 2266| BLEND_MODE_HARD_LIGHT | Hard light mode.| 2267| BLEND_MODE_SOFT_LIGHT | Soft light mode.| 2268| BLEND_MODE_DIFFERENCE | Difference mode. rc = s + d - 2 \* (min(s \* da, d \* sa)), ra = s + (1 - sa) \* d| 2269| BLEND_MODE_EXCLUSION | Exclusion mode. rc = s + d - two(s \* d), ra = s + (1 - sa) \* d| 2270| BLEND_MODE_MULTIPLY | Multiply mode. r = s \* (1 - da) + d \* (1 - sa) + s \* d| 2271| BLEND_MODE_HUE | Hue mode.| 2272| BLEND_MODE_SATURATION | Saturation mode.| 2273| BLEND_MODE_COLOR | Color mode.| 2274| BLEND_MODE_LUMINOSITY | Luminosity mode.| 2275 2276 2277### OH_Drawing_BlurType 2278 2279``` 2280enum OH_Drawing_BlurType 2281``` 2282 2283**Description** 2284 2285Enumerates the blur types. 2286 2287**Since**: 11 2288 2289| Value| Description| 2290| -------- | -------- | 2291| NORMAL | Blurs both inside and outside the original border.| 2292| SOLID | Draws solid inside the border, and blurs outside.| 2293| OUTER | Draws nothing inside the border, and blurs outside.| 2294| INNER | Blurs inside the border, and draws nothing outside.| 2295 2296 2297### OH_Drawing_BreakStrategy 2298 2299``` 2300enum OH_Drawing_BreakStrategy 2301``` 2302 2303**Description** 2304 2305Enumerates the text break strategies. 2306 2307**Since**: 11 2308 2309| Value| Description| 2310| -------- | -------- | 2311| BREAK_STRATEGY_GREEDY | Each line is filled as much as possible during line break.| 2312| BREAK_STRATEGY_HIGH_QUALITY | Text continuity is preferentially considered during line break.| 2313| BREAK_STRATEGY_BALANCED | Line breaks are performed at the word boundary.| 2314 2315 2316### OH_Drawing_CanvasClipOp 2317 2318``` 2319enum OH_Drawing_CanvasClipOp 2320``` 2321 2322**Description** 2323 2324Enumerates the canvas clipping modes. 2325 2326**Since**: 11 2327 2328| Value| Description| 2329| -------- | -------- | 2330| DIFFERENCE | Clips a specified area. That is, the difference set is obtained.| 2331| INTERSECT | Retains a specified area. That is, the intersection is obtained.| 2332 2333 2334### OH_Drawing_CanvasShadowFlags 2335 2336``` 2337enum OH_Drawing_CanvasShadowFlags 2338``` 2339 2340**Description** 2341 2342Enumerates the shadow flags. 2343 2344**Since**: 12 2345 2346| Value| Description| 2347| -------- | -------- | 2348| SHADOW_FLAGS_NONE | There is no shadow flag.| 2349| SHADOW_FLAGS_TRANSPARENT_OCCLUDER | The occluding object is transparent.| 2350| SHADOW_FLAGS_GEOMETRIC_ONLY | No analysis on the shadows is required.| 2351| SHADOW_FLAGS_ALL | All the preceding shadow flags are used.| 2352 2353 2354### OH_Drawing_ColorFormat 2355 2356``` 2357enum OH_Drawing_ColorFormat 2358``` 2359 2360**Description** 2361 2362Enumerates the storage formats of bitmap pixels. 2363 2364**Since**: 8 2365 2366| Value| Description| 2367| -------- | -------- | 2368| COLOR_FORMAT_UNKNOWN | Unknown format.| 2369| COLOR_FORMAT_ALPHA_8 | Each pixel is represented by 8 bits, which together indicate alpha.| 2370| COLOR_FORMAT_RGB_565 | Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, the first 5 bits indicate red, the subsequent 6 bits indicate green, and the last 5 bits indicate blue.| 2371| COLOR_FORMAT_ARGB_4444 | Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, every 4 bits indicate alpha, red, green, and blue, respectively.| 2372| COLOR_FORMAT_RGBA_8888 | Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits indicate alpha, red, green, and blue, respectively.| 2373| COLOR_FORMAT_BGRA_8888 | Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits indicate blue, green, red, and alpha, respectively.| 2374 2375 2376### OH_Drawing_CornerPos 2377 2378``` 2379enum OH_Drawing_CornerPos 2380``` 2381 2382**Description** 2383 2384Enumerates the corner positions of a rounded rectangle. 2385 2386**Since**: 12 2387 2388| Value| Description| 2389| -------- | -------- | 2390| CORNER_POS_TOP_LEFT | Top left corner of the rounded rectangle.| 2391| CORNER_POS_TOP_RIGHT | Top right corner of the rounded rectangle.| 2392| CORNER_POS_BOTTOM_RIGHT | Bottom right corner of the rounded rectangle.| 2393| CORNER_POS_BOTTOM_LEFT | Bottom left corner of the rounded rectangle.| 2394 2395 2396### OH_Drawing_EllipsisModal 2397 2398``` 2399enum OH_Drawing_EllipsisModal 2400``` 2401 2402**Description** 2403 2404Enumerates the text ellipsis styles. 2405 2406**Since**: 11 2407 2408| Value| Description| 2409| -------- | -------- | 2410| ELLIPSIS_MODAL_HEAD | Places the ellipsis in the text header.| 2411| ELLIPSIS_MODAL_MIDDLE | Places the ellipsis in the middle of the text.| 2412| ELLIPSIS_MODAL_TAIL | Places the ellipsis at the end of the text.| 2413 2414 2415### OH_Drawing_FilterMode 2416 2417``` 2418enum OH_Drawing_FilterMode 2419``` 2420 2421**Description** 2422 2423Enumerates the filter modes. 2424 2425**Since**: 12 2426 2427| Value| Description| 2428| -------- | -------- | 2429| FILTER_MODE_NEAREST | Nearest filter mode.| 2430| FILTER_MODE_LINEAR | Linear filter mode.| 2431 2432 2433### OH_Drawing_FontConfigInfoErrorCode 2434 2435``` 2436enum OH_Drawing_FontConfigInfoErrorCode 2437``` 2438 2439**Description** 2440 2441Enumerates the error codes that may be used during the obtaining of system font configurations. 2442 2443**Since**: 12 2444 2445| Value| Description| 2446| -------- | -------- | 2447| SUCCESS_FONT_CONFIG_INFO | Operation successful.| 2448| ERROR_FONT_CONFIG_INFO_UNKNOWN | Unknown error.| 2449| ERROR_FONT_CONFIG_INFO_PARSE_FILE | Failed to parse the system configuration file.| 2450| ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY | Failed to apply for a buffer.| 2451| ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA | Failed to copy the string data.| 2452 2453 2454### OH_Drawing_FontEdging 2455 2456``` 2457enum OH_Drawing_FontEdging 2458``` 2459 2460**Description** 2461 2462Enumerates the font edging types. 2463 2464**Since**: 12 2465 2466| Value| Description| 2467| -------- | -------- | 2468| FONT_EDGING_ALIAS | No anti-aliasing processing is used.| 2469| FONT_EDGING_ANTI_ALIAS | Uses anti-aliasing to smooth the jagged edges.| 2470| FONT_EDGING_SUBPIXEL_ANTI_ALIAS | Uses sub-pixel anti-aliasing to provide a smoother effect for jagged edges.| 2471 2472 2473### OH_Drawing_FontHinting 2474 2475``` 2476enum OH_Drawing_FontHinting 2477``` 2478 2479**Description** 2480 2481Enumerates the font hinting types. 2482 2483**Since**: 12 2484 2485| Value| Description| 2486| -------- | -------- | 2487| FONT_HINTING_NONE | No font hinting is used.| 2488| FONT_HINTING_SLIGHT | Slight font hinting is used to improve contrast.| 2489| FONT_HINTING_NORMAL | Normal font hinting is used to improve contrast.| 2490| FONT_HINTING_FULL | Full font hinting is used to improve contrast.| 2491 2492 2493### OH_Drawing_FontStyle 2494 2495``` 2496enum OH_Drawing_FontStyle 2497``` 2498 2499**Description** 2500 2501Enumerates the font styles. 2502 2503| Value| Description| 2504| -------- | -------- | 2505| FONT_STYLE_NORMAL | Normal style.| 2506| FONT_STYLE_ITALIC | Italic.| 2507| FONT_STYLE_OBLIQUE | Oblique.<br>Since:<br>12 | 2508 2509 2510### OH_Drawing_FontWeight 2511 2512``` 2513enum OH_Drawing_FontWeight 2514``` 2515 2516**Description** 2517 2518Enumerates the font weights. 2519 2520| Value| Description| 2521| -------- | -------- | 2522| FONT_WEIGHT_100 | Thin.| 2523| FONT_WEIGHT_200 | Extra-light.| 2524| FONT_WEIGHT_300 | Light.| 2525| FONT_WEIGHT_400 | Normal/Regular.| 2526| FONT_WEIGHT_500 | Medium.| 2527| FONT_WEIGHT_600 | Semi-bold.| 2528| FONT_WEIGHT_700 | Bold.| 2529| FONT_WEIGHT_800 | Extra-bold.| 2530| FONT_WEIGHT_900 | Black.| 2531 2532 2533### OH_Drawing_FontWidth 2534 2535``` 2536enum OH_Drawing_FontWidth 2537``` 2538 2539**Description** 2540 2541Enumerates the font widths. 2542 2543**Since**: 12 2544 2545 2546### OH_Drawing_MipmapMode 2547 2548``` 2549enum OH_Drawing_MipmapMode 2550``` 2551 2552**Description** 2553 2554Enumerates the mipmap modes. 2555 2556**Since**: 12 2557 2558| Value| Description| 2559| -------- | -------- | 2560| MIPMAP_MODE_NONE | Mipmap level ignored.| 2561| MIPMAP_MODE_NEAREST | Nearest sampling from two adjacent mipmap levels.| 2562| MIPMAP_MODE_LINEAR | Linear interpolation sampling between two adjacent mipmap levels.| 2563 2564 2565### OH_Drawing_PathAddMode 2566 2567``` 2568enum OH_Drawing_PathAddMode 2569``` 2570 2571**Description** 2572 2573Enumerates the path adding modes. 2574 2575**Since**: 12 2576 2577| Value| Description| 2578| -------- | -------- | 2579| PATH_ADD_MODE_APPEND | Adds a path in append mode.| 2580| PATH_ADD_MODE_EXTEND | Adds a line segment to close the path if the previous path is not closed.| 2581 2582 2583### OH_Drawing_PathDirection 2584 2585``` 2586enum OH_Drawing_PathDirection 2587``` 2588 2589**Description** 2590 2591Enumerates the directions of a closed contour. 2592 2593**Since**: 12 2594 2595| Value| Description| 2596| -------- | -------- | 2597| PATH_DIRECTION_CW | Adds a closed contour clockwise.| 2598| PATH_DIRECTION_CCW | Adds a closed contour counterclockwise.| 2599 2600 2601### OH_Drawing_PathFillType 2602 2603``` 2604enum OH_Drawing_PathFillType 2605``` 2606 2607**Description** 2608 2609Enumerates the fill types of a path. 2610 2611**Since**: 12 2612 2613| Value| Description| 2614| -------- | -------- | 2615| PATH_FILL_TYPE_WINDING | Specifies that "inside" is computed by a non-zero sum of signed edge crossings. Specifically, draws a point and emits a ray in any direction. A count is used to record the number of intersection points of the ray and path, and the initial count is 0. When encountering a clockwise intersection point (the path passes from the left to the right of the ray), the count increases by 1. When encountering a counterclockwise intersection point (the path passes from the right to the left of the ray), the count decreases by 1. If the final count is not 0, the point is inside the path and needs to be colored. If the final count is 0, the point is not colored.| 2616| PATH_FILL_TYPE_EVEN_ODD | Specifies that "inside" is computed by an odd number of edge crossings. Specifically, draws a point and emits a ray in any direction. If the number of intersection points of the ray and path is an odd number, the point is considered to be inside the path and needs to be colored. If the number is an even number, the point is not colored.| 2617| PATH_FILL_TYPE_INVERSE_WINDING | Same as **PATH_FILL_TYPE_WINDING**, but draws outside of the path, rather than inside.| 2618| PATH_FILL_TYPE_INVERSE_EVEN_ODD | Same as **PATH_FILL_TYPE_EVEN_ODD**, but draws outside of the path, rather than inside.| 2619 2620 2621### OH_Drawing_PenLineCapStyle 2622 2623``` 2624enum OH_Drawing_PenLineCapStyle 2625``` 2626 2627**Description** 2628 2629Enumerates the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen. 2630 2631**Since**: 8 2632 2633| Value| Description| 2634| -------- | -------- | 2635| LINE_FLAT_CAP | There is no cap style. Both ends of the line segment are cut off square.| 2636| LINE_SQUARE_CAP | Square cap style. Both ends have a square, the height of which is half of the width of the line segment, with the same width.| 2637| LINE_ROUND_CAP | Round cap style. Both ends have a semicircle centered, the diameter of which is the same as the width of the line segment.| 2638 2639 2640### OH_Drawing_PenLineJoinStyle 2641 2642``` 2643enum OH_Drawing_PenLineJoinStyle 2644``` 2645 2646**Description** 2647 2648Enumerates the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen. 2649 2650**Since**: 8 2651 2652| Value| Description| 2653| -------- | -------- | 2654| LINE_MITER_JOIN | Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate. In this case, you need to use the miter limit to limit the miter length.| 2655| LINE_ROUND_JOIN | Round corner.| 2656| LINE_BEVEL_JOIN | Beveled corner.| 2657 2658 2659### OH_Drawing_PlaceholderVerticalAlignment 2660 2661``` 2662enum OH_Drawing_PlaceholderVerticalAlignment 2663``` 2664 2665**Description** 2666 2667Enumerates the vertical alignment modes of placeholders. 2668 2669**Since**: 11 2670 2671| Value| Description| 2672| -------- | -------- | 2673| ALIGNMENT_OFFSET_AT_BASELINE | Aligned to the baseline.| 2674| ALIGNMENT_ABOVE_BASELINE | Aligned above the baseline.| 2675| ALIGNMENT_BELOW_BASELINE | Aligned below the baseline.| 2676| ALIGNMENT_TOP_OF_ROW_BOX | Aligned to the top of the row box.| 2677| ALIGNMENT_BOTTOM_OF_ROW_BOX | Aligned to the bottom of the row box.| 2678| ALIGNMENT_CENTER_OF_ROW_BOX | Aligned to the center of the row box.| 2679 2680 2681### OH_Drawing_PointMode 2682 2683``` 2684enum OH_Drawing_PointMode 2685``` 2686 2687**Description** 2688 2689Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons. 2690 2691**Since**: 12 2692 2693| Value| Description| 2694| -------- | -------- | 2695| POINT_MODE_POINTS | Draws each point separately.| 2696| POINT_MODE_LINES | Draws every two points as a line segment.| 2697| POINT_MODE_POLYGON | Draws an array of points as an open polygon.| 2698 2699 2700### OH_Drawing_RectHeightStyle 2701 2702``` 2703enum OH_Drawing_RectHeightStyle 2704``` 2705 2706**Description** 2707 2708Enumerates the rectangle height styles. 2709 2710**Since**: 11 2711 2712| Value| Description| 2713| -------- | -------- | 2714| RECT_HEIGHT_STYLE_TIGHT | Tight style.| 2715| RECT_HEIGHT_STYLE_MAX | Maximum style.| 2716| RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE | Middle style that includes the line spacing.| 2717| RECT_HEIGHT_STYLE_INCLUDELINESPACETOP | Top style that includes the line spacing.| 2718| RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM | Bottom style that includes the line spacing.| 2719| RECT_HEIGHT_STYLE_STRUCT | Structure style.| 2720 2721 2722### OH_Drawing_RectWidthStyle 2723 2724``` 2725enum OH_Drawing_RectWidthStyle 2726``` 2727 2728**Description** 2729 2730Enumerates the rectangle width styles. 2731 2732**Since**: 11 2733 2734| Value| Description| 2735| -------- | -------- | 2736| RECT_WIDTH_STYLE_TIGHT | Tight style.| 2737| RECT_WIDTH_STYLE_MAX | Maximum style.| 2738 2739 2740### OH_Drawing_ScaleToFit 2741 2742``` 2743enum OH_Drawing_ScaleToFit 2744``` 2745 2746**Description** 2747 2748Enumerates the matrix scaling modes. 2749 2750**Since**: 12 2751 2752| Value| Description| 2753| -------- | -------- | 2754| SCALE_TO_FIT_FILL | Scales the source rectangle both horizontally and vertically to exactly match the destination rectangle.| 2755| SCALE_TO_FIT_START | Scales the source rectangle and aligns it to the left and top edges of the destination rectangle.| 2756| SCALE_TO_FIT_CENTER | Scales the source rectangle and aligns it to the center of the destination rectangle.| 2757| SCALE_TO_FIT_END | Scales the source rectangle and aligns it to the right and bottom edges of the destination rectangle.| 2758 2759 2760### OH_Drawing_SrcRectConstraint 2761 2762``` 2763enum OH_Drawing_SrcRectConstraint 2764``` 2765 2766**Description** 2767 2768Enumerates the constraint types of the source rectangle. 2769 2770**Since**: 12 2771 2772| Value| Description| 2773| -------- | -------- | 2774| STRICT_SRC_RECT_CONSTRAINT | The source rectangle must be completely contained in the image.| 2775| FAST_SRC_RECT_CONSTRAINT | The source rectangle can be partly outside the image.| 2776 2777 2778### OH_Drawing_TextAlign 2779 2780``` 2781enum OH_Drawing_TextAlign 2782``` 2783 2784**Description** 2785 2786Enumerates the text alignment modes. 2787 2788| Value| Description| 2789| -------- | -------- | 2790| TEXT_ALIGN_LEFT | Left-aligned.| 2791| TEXT_ALIGN_RIGHT | Right-aligned.| 2792| TEXT_ALIGN_CENTER | Center-aligned.| 2793| TEXT_ALIGN_JUSTIFY | Justified, which means that each line (except the last line) is stretched so that every line has equal width, and the left and right margins are straight.| 2794| TEXT_ALIGN_START | **TEXT_ALIGN_START** achieves the same effect as **TEXT_ALIGN_LEFT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_LTR**; it achieves the same effect as **TEXT_ALIGN_RIGHT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_RTL**.| 2795| TEXT_ALIGN_END | **TEXT_ALIGN_END** achieves the same effect as **TEXT_ALIGN_RIGHT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_LTR**; it achieves the same effect as **TEXT_ALIGN_LEFT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_RTL**.| 2796 2797 2798### OH_Drawing_TextBaseline 2799 2800``` 2801enum OH_Drawing_TextBaseline 2802``` 2803 2804**Description** 2805 2806Enumerates the text baselines. 2807 2808| Value| Description| 2809| -------- | -------- | 2810| TEXT_BASELINE_ALPHABETIC | Alphabetic, where the letters in alphabets like English sit on.| 2811| TEXT_BASELINE_IDEOGRAPHIC | Ideographic, where the baseline is at the bottom of the text area.| 2812 2813 2814### OH_Drawing_TextDecoration 2815 2816``` 2817enum OH_Drawing_TextDecoration 2818``` 2819 2820**Description** 2821 2822Enumerates the text decorations. 2823 2824| Value| Description| 2825| -------- | -------- | 2826| TEXT_DECORATION_NONE | No decoration.| 2827| TEXT_DECORATION_UNDERLINE | An underline is used for decoration.| 2828| TEXT_DECORATION_OVERLINE | An overline is used for decoration.| 2829| TEXT_DECORATION_LINE_THROUGH | A strikethrough is used for decoration.| 2830 2831 2832### OH_Drawing_TextDecorationStyle 2833 2834``` 2835enum OH_Drawing_TextDecorationStyle 2836``` 2837 2838**Description** 2839 2840Enumerates the text decoration styles. 2841 2842**Since**: 11 2843 2844| Value| Description| 2845| -------- | -------- | 2846| TEXT_DECORATION_STYLE_SOLID | Solid style.| 2847| TEXT_DECORATION_STYLE_DOUBLE | Double style.| 2848| TEXT_DECORATION_STYLE_DOTTED | Dotted style.| 2849| TEXT_DECORATION_STYLE_DASHED | Dashed style.| 2850| TEXT_DECORATION_STYLE_WAVY | Wavy style.| 2851 2852 2853### OH_Drawing_TextDirection 2854 2855``` 2856enum OH_Drawing_TextDirection 2857``` 2858 2859**Description** 2860 2861Enumerates the text directions. 2862 2863| Value| Description| 2864| -------- | -------- | 2865| TEXT_DIRECTION_RTL | Right to left (RTL).| 2866| TEXT_DIRECTION_LTR | Left to right (LTR).| 2867 2868 2869### OH_Drawing_TextEncoding 2870 2871``` 2872enum OH_Drawing_TextEncoding 2873``` 2874 2875**Description** 2876 2877Enumerates the text encoding types. 2878 2879**Since**: 12 2880 2881| Value| Description| 2882| -------- | -------- | 2883| TEXT_ENCODING_UTF8 | One byte used to indicate UTF-8 or ASCII characters.| 2884| TEXT_ENCODING_UTF16 | Two bytes used to indicate most Unicode characters.| 2885| TEXT_ENCODING_UTF32 | Four bytes used to indicate all Unicode characters.| 2886| TEXT_ENCODING_GLYPH_ID | Two bytes used to indicate the glyph index.| 2887 2888 2889### OH_Drawing_TextHeightBehavior 2890 2891``` 2892enum OH_Drawing_TextHeightBehavior 2893``` 2894 2895**Description** 2896 2897Enumerates the text height modifier patterns. 2898 2899**Since**: 12 2900 2901| Value| Description| 2902| -------- | -------- | 2903| TEXT_HEIGHT_ALL | Enables ascent for the first and last rows of a paragraph.| 2904| TEXT_HEIGHT_DISABLE_FIRST_ASCENT | Disables ascent for the first row of a paragraph.| 2905| TEXT_HEIGHT_DISABLE_LAST_ASCENT | Disables ascent for the last row of a paragraph.| 2906| TEXT_HEIGHT_DISABLE_ALL | Disables ascent for the first and last rows of a paragraph.| 2907 2908 2909### OH_Drawing_TextStyleType 2910 2911``` 2912enum OH_Drawing_TextStyleType 2913``` 2914 2915**Description** 2916 2917Enumerates the text style types. 2918 2919**Since**: 12 2920 2921| Value| Description| 2922| -------- | -------- | 2923| TEXT_STYLE_NONE | No text style.| 2924| TEXT_STYLE_ALL_ATTRIBUTES | All text styles.| 2925| TEXT_STYLE_FONT | Font style.| 2926| TEXT_STYLE_FOREGROUND | Text foreground style.| 2927| TEXT_STYLE_BACKGROUND | Text background style.| 2928| TEXT_STYLE_SHADOW | Text shadow style.| 2929| TEXT_STYLE_DECORATIONS | Text decoration style.| 2930| TEXT_STYLE_LETTER_SPACING | Text letter spacing style.| 2931| TEXT_STYLE_WORD_SPACING | Text word spacing style.| 2932 2933 2934### OH_Drawing_TileMode 2935 2936``` 2937enum OH_Drawing_TileMode 2938``` 2939 2940**Description** 2941 2942Enumerates the tile modes of the shader effect. 2943 2944**Since**: 11 2945 2946| Value| Description| 2947| -------- | -------- | 2948| CLAMP | Replicates the edge color if the shader effect draws outside of its original boundary.| 2949| REPEAT | Repeats the shader effect's image in both horizontal and vertical directions.| 2950| MIRROR | Repeats the shader effect's image in both horizontal and vertical directions, alternating mirror images.| 2951| DECAL | Renders the shader effect's image only within the original boundary, and returns transparent black elsewhere.| 2952 2953 2954### OH_Drawing_VertexMode 2955 2956``` 2957enum OH_Drawing_VertexMode 2958``` 2959 2960**Description** 2961 2962Enumerates the modes of interpreting the geometry of a given vertex. 2963 2964**Since**: 12 2965 2966| Value| Description| 2967| -------- | -------- | 2968| VERTEX_MODE_TRIANGLES | Draws a triangle list. Specifically, a list of isolated triangles are drawn using every three vertices. If the number of vertices is not a multiple of 3, the extra vertices will be ignored. | 2969| VERTEX_MODE_TRIANGLESSTRIP | Draws a triangle strip. Specifically, the first triangle is drawn between the first 3 vertices, and all subsequent triangles use the previous 2 vertices plus the next additional vertex.| 2970| VERTEX_MODE_TRIANGLEFAN | Draws a triangle fan. A triangle fan is similar to a triangle strip, except that all the triangles share one vertex (the first vertex).| 2971 2972 2973### OH_Drawing_WordBreakType 2974 2975``` 2976enum OH_Drawing_WordBreakType 2977``` 2978 2979**Description** 2980 2981Enumerates the word break types. 2982 2983**Since**: 11 2984 2985| Value| Description| 2986| -------- | -------- | 2987| WORD_BREAK_TYPE_NORMAL | Normal mode.| 2988| WORD_BREAK_TYPE_BREAK_ALL | Breaks the words at any character to prevent overflow.| 2989| WORD_BREAK_TYPE_BREAK_WORD | Breaks the words at arbitrary points to prevent overflow.| 2990 2991 2992 2993## Function Description 2994 2995### OH_Drawing_GetFontCollectionGlobalInstance() 2996 2997``` 2998OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance (void ) 2999``` 3000**Description** 3001 3002Obtains the global **OH_Drawing_FontCollection** object, which can be used to sense the theme font information. Do not release the object. 3003 3004**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3005 3006**Since**: 14 3007 3008**Returns** 3009 3010Returns the pointer to the global {@link OH_Drawing_FontCollection} object obtained. 3011 3012### OH_Drawing_GetDrawingArraySize() 3013 3014``` 3015size_t OH_Drawing_GetDrawingArraySize (OH_Drawing_Array* drawingArray) 3016``` 3017 3018**Description** 3019 3020Obtains the number of objects in an [OH_Drawing_Array](#oh_drawing_array). 3021 3022**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3023 3024**Since**: 14 3025 3026**Parameters** 3027 3028| Name| Description| 3029| -------- | -------- | 3030| drawingArray | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.| 3031 3032**Returns** 3033 3034Returns the number of objects in the array. 3035 3036### OH_Drawing_DestroySystemFontFullNames() 3037 3038``` 3039void OH_Drawing_DestroySystemFontFullNames (OH_Drawing_Array* ) 3040``` 3041 3042**Description** 3043 3044Releases the memory occupied by the font name array obtained by font type. 3045 3046**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3047 3048**Since**: 14 3049 3050**Parameters** 3051 3052| Name| Description| 3053| -------- | -------- | 3054| OH_Drawing_Array | Pointer to an [OH_Drawing_Array](#oh_drawing_array) that holds the font names.| 3055 3056### OH_Drawing_GetSystemFontFullNameByIndex() 3057 3058``` 3059const OH_Drawing_String* OH_Drawing_GetSystemFontFullNameByIndex (OH_Drawing_Array* , size_t ) 3060``` 3061 3062**Description** 3063 3064Obtains the font name with the specified index in the font name array. 3065 3066**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3067 3068**Since**: 14 3069 3070**Parameters** 3071 3072| Name| Description| 3073| -------- | -------- | 3074| OH_Drawing_Array | Pointer to an [OH_Drawing_Array](#oh_drawing_array) that holds the font names.| 3075| size_t | Index of the font in the array.| 3076 3077**Returns** 3078 3079Returns the pointer to the font name, which is an [OH_Drawing_String](_o_h___drawing___string.md) object. 3080 3081### OH_Drawing_GetSystemFontFullNamesByType() 3082 3083``` 3084OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType (OH_Drawing_SystemFontType ) 3085``` 3086 3087**Description** 3088 3089Obtains an array of font names by font type. 3090 3091**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3092 3093**Since**: 14 3094 3095**Parameters** 3096 3097| Name| Description| 3098| -------- | -------- | 3099| OH_Drawing_SystemFontType | Font type, which is defined in [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype).| 3100 3101**Returns** 3102 3103Returns the pointer to an [OH_Drawing_Array](#oh_drawing_array), which holds the font names. 3104 3105### OH_Drawing_GetFontDescriptorByFullName() 3106 3107``` 3108OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName (const OH_Drawing_String* , OH_Drawing_SystemFontType ) 3109``` 3110 3111**Description** 3112 3113Obtains a font descriptor based on the font name and type. System fonts, style fonts, and user-installed fonts are supported. A font descriptor is a data structure that describes font features. It contains details of the font appearance and properties. 3114 3115**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3116 3117**Since**: 14 3118 3119**Parameters** 3120 3121| Name| Description| 3122| -------- | -------- | 3123| [OH_Drawing_String](_o_h___drawing___string.md) | Pointer to the font name, which is [OH_Drawing_String](_o_h___drawing___string.md).| 3124| OH_Drawing_SystemFontType | Font type, which is defined in [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype).| 3125 3126**Returns** 3127 3128Returns the pointer to an [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object. 3129 3130### OH_Drawing_TypefaceCreateFromFileWithArguments() 3131 3132``` 3133OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFileWithArguments (const char* path, const OH_Drawing_FontArguments* fontArguments ) 3134``` 3135 3136**Description** 3137 3138Creates an **OH_Drawing_Typeface** object with font arguments through a file. If the **OH_Drawing_Typeface** object does not support the variation described in the font arguments, this function creates an **OH_Drawing_Typeface** object with the default font arguments. In this case, this function provides the same capability as [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile). 3139 3140**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3141 3142**Since**: 13 3143 3144**Parameters** 3145 3146| Name| Description| 3147| -------- | -------- | 3148| path | Pointer to the file path.| 3149| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.| 3150 3151**Returns** 3152 3153Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **path** or **fontArguments** is NULL, or the path is invalid. 3154 3155 3156### OH_Drawing_TypefaceCreateFromCurrent() 3157 3158``` 3159OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromCurrent (const OH_Drawing_Typeface* current, const OH_Drawing_FontArguments* fontArguments ) 3160``` 3161 3162**Description** 3163 3164Creates an **OH_Drawing_Typeface** object with font arguments based on an existing **OH_Drawing_Typeface** object. 3165 3166**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3167 3168**Since**: 13 3169 3170**Parameters** 3171 3172| Name| Description| 3173| -------- | -------- | 3174| current | Pointer to an [OH_Drawing_Typeface](#oh_drawing_typeface) object.| 3175| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.| 3176 3177**Returns** 3178 3179Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **path** or **fontArguments** is NULL, or the existing **OH_Drawing_FontArguments** object does not support the variation described in the font arguments. 3180 3181 3182### OH_Drawing_FontArgumentsAddVariation() 3183 3184``` 3185OH_Drawing_ErrorCode OH_Drawing_FontArgumentsAddVariation (OH_Drawing_FontArguments* fontArguments, const char* axis, float value ) 3186``` 3187 3188**Description** 3189 3190Adds a variation to an **OH_Drawing_FontArguments** object. 3191 3192**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3193 3194**Since**: 13 3195 3196**Parameters** 3197 3198| Name| Description| 3199| -------- | -------- | 3200| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.| 3201| axis | Pointer to the label of the variation. The value must contain four ASCII characters. The supported labels depend on the loaded font file. For example, **'wght'** is the font weight label.| 3202| value | Value of the variation label.| 3203 3204**Returns** 3205 3206Returns one of the following result codes: 3207- **OH_DRAWING_SUCCESS** if the operation is successful. 3208- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **fontArguments** or **axis** is NULL or the length of **axis** is not 4. 3209 3210 3211### OH_Drawing_FontArgumentsCreate() 3212 3213``` 3214OH_Drawing_FontArguments* OH_Drawing_FontArgumentsCreate (void) 3215``` 3216 3217**Description** 3218 3219Creates an **OH_Drawing_FontArguments** object. The font arguments are used to create an **OH_Drawing_Typeface** object with custom attributes. 3220 3221**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3222 3223**Since**: 13 3224 3225**Returns** 3226 3227Returns the pointer to the **OH_Drawing_FontArguments** object created. 3228 3229 3230### OH_Drawing_FontArgumentsDestroy() 3231 3232``` 3233OH_Drawing_ErrorCode OH_Drawing_FontArgumentsDestroy (OH_Drawing_FontArguments* fontArguments) 3234``` 3235 3236**Description** 3237 3238Destroys an **OH_Drawing_FontArguments** object. 3239 3240**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3241 3242**Since**: 13 3243 3244**Parameters** 3245 3246| Name| Description| 3247| -------- | -------- | 3248| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.| 3249 3250**Returns** 3251 3252Returns one of the following result codes: 3253- **OH_DRAWING_SUCCESS** if the operation is successful. 3254- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **fontArguments** is NULL. 3255 3256 3257### OH_Drawing_TypographyGetLongestLineWithIndent() 3258 3259``` 3260double OH_Drawing_TypographyGetLongestLineWithIndent (OH_Drawing_Typography* ) 3261``` 3262 3263**Description** 3264 3265Obtains the width of the longest line, including its indentation. You are advised to round up the return value in actual use. If the text content is empty, **0.0** is returned. 3266 3267**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3268 3269**Since**: 13 3270 3271**Parameters** 3272 3273| Name| Description| 3274| -------- | -------- | 3275| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography).| 3276 3277**Returns** 3278 3279Returns the width of the longest line, including its indentation, in px. 3280 3281 3282 3283### OH_Drawing_RecordCmdDestroy() 3284 3285``` 3286OH_Drawing_ErrorCode OH_Drawing_RecordCmdDestroy (OH_Drawing_RecordCmd* recordCmd) 3287``` 3288 3289**Description** 3290 3291Destroys an **OH_Drawing_RecordCmd** object and reclaims the memory occupied by the object. 3292 3293**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3294 3295**Since**: 13 3296 3297**Parameters** 3298 3299| Name| Description| 3300| -------- | -------- | 3301| recordCmd | Pointer to an [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object.| 3302 3303**Returns** 3304 3305Returns one of the following result codes: 3306- **OH_DRAWING_SUCCESS** if the operation is successful. 3307- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmd** is NULL. 3308 3309 3310### OH_Drawing_RecordCmdUtilsBeginRecording() 3311 3312``` 3313OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording (OH_Drawing_RecordCmdUtils* recordCmdUtils, int32_t width, int32_t height, OH_Drawing_Canvas** canvas ) 3314``` 3315 3316**Description** 3317 3318Starts recording. This function must be used in pair with [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording). 3319 3320The **OH_Drawing_RecordCmdUtils** object generates a canvas object of the recording type and calls the interface of the drawing object to record all drawing commands. 3321 3322**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3323 3324**Since**: 13 3325 3326**Parameters** 3327 3328| Name| Description| 3329| -------- | -------- | 3330| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.| 3331| width | Width of the canvas.| 3332| height | Height of the canvas.| 3333| canvas | Double pointer to the [OH_Drawing_Canvas](#oh_drawing_canvas) object. You do not need to release this pointer. This object does not support nested calling of [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd).| 3334 3335**Returns** 3336 3337Returns one of the following result codes: 3338- **OH_DRAWING_SUCCESS** if the operation is successful. 3339- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **canvas** is NULL. 3340- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **width** or **height** is less than 0. 3341- **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient. 3342 3343 3344### OH_Drawing_RecordCmdUtilsCreate() 3345 3346``` 3347OH_Drawing_RecordCmdUtils* OH_Drawing_RecordCmdUtilsCreate (void ) 3348``` 3349 3350**Description** 3351 3352Creates an **OH_Drawing_RecordCmdUtils** object. 3353 3354**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3355 3356**Since**: 13 3357 3358**Returns** 3359 3360Returns the pointer to the **OH_Drawing_RecordCmdUtils** object created. 3361 3362 3363### OH_Drawing_RecordCmdUtilsDestroy() 3364 3365``` 3366OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsDestroy (OH_Drawing_RecordCmdUtils* recordCmdUtils) 3367``` 3368 3369**Description** 3370 3371Destroys an **OH_Drawing_RecordCmdUtils** object and reclaims the memory occupied by the object. 3372 3373**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3374 3375**Since**: 13 3376 3377**Parameters** 3378 3379| Name| Description| 3380| -------- | -------- | 3381| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.| 3382 3383**Returns** 3384 3385Returns one of the following result codes: 3386- **OH_DRAWING_SUCCESS** if the operation is successful. 3387- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmdUtils** is NULL. 3388 3389 3390### OH_Drawing_RecordCmdUtilsFinishRecording() 3391 3392``` 3393OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsFinishRecording (OH_Drawing_RecordCmdUtils* recordCmdUtils, OH_Drawing_RecordCmd** recordCmd ) 3394``` 3395 3396**Description** 3397 3398Ends recording. This function must be called after [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording). 3399 3400The **OH_Drawing_RecordCmdUtils** object ends recording and stores the drawing commands recorded by the canvas object of the recording type into the generated [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) object. 3401 3402**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3403 3404**Since**: 13 3405 3406**Parameters** 3407 3408| Name| Description| 3409| -------- | -------- | 3410| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.| 3411| recordCmd | Double pointer to the [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object. You need to call [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd) to draw the object, and call [OH_Drawing_RecordCmdDestroy](#oh_drawing_recordcmddestroy) to release it.| 3412 3413**Returns** 3414 3415Returns one of the following result codes: 3416- **OH_DRAWING_SUCCESS** if the operation is successful. 3417- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **recordCmd** is NULL. 3418- **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient. 3419 3420 3421### OH_Drawing_CanvasDrawRecordCmd() 3422 3423``` 3424OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd (OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd ) 3425``` 3426 3427**Description** 3428 3429Draws an **OH_Drawing_RecordCmd** object. 3430 3431**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3432 3433**Since**: 13 3434 3435**Parameters** 3436 3437| Name| Description| 3438| -------- | -------- | 3439| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. Only a canvas of the recording type is supported.| 3440| recordCmd | Pointer to the [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object.| 3441 3442**Returns** 3443 3444Returns one of the following result codes: 3445- **OH_DRAWING_SUCCESS** if the operation is successful. 3446- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL. 3447 3448 3449 3450### OH_Drawing_TypographyDestroyTextBox() 3451 3452``` 3453void OH_Drawing_TypographyDestroyTextBox (OH_Drawing_TextBox* ) 3454``` 3455 3456**Description** 3457 3458Releases the memory occupied by a text box. 3459 3460**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3461 3462**Since**: 12 3463 3464**Parameters** 3465 3466| Name| Description| 3467| -------- | -------- | 3468| OH_Drawing_TextBox | Pointer to an [OH_Drawing_TextBox](#oh_drawing_textbox) object.| 3469 3470 3471### OH_Drawing_SetTextShadow() 3472 3473``` 3474void OH_Drawing_SetTextShadow (OH_Drawing_TextShadow* shadow, uint32_t color, OH_Drawing_Point* offset, double blurRadius ) 3475``` 3476 3477**Description** 3478 3479Sets a text shadow. 3480 3481**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3482 3483**Since**: 12 3484 3485**Parameters** 3486 3487| Name| Description| 3488| -------- | -------- | 3489| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow).| 3490| color | Color of the text shadow. For example, if the input parameter is 0xAABBCCDD, AA indicates opacity, BB indicates the value of the red component, CC indicates the value of the green component, and DD indicates the value of the blue component.| 3491| OH_Drawing_Point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object, which is the position of the text shadow relative to the text.| 3492| blurRadius | Blur radius. The value is a floating point number and has no unit. The value **0.0** means that there is no blur effect.| 3493 3494 3495 3496### OH_Drawing_CanvasDrawSingleCharacter() 3497 3498``` 3499OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacter (OH_Drawing_Canvas* canvas, const char* str, const OH_Drawing_Font* font, float x, float y ) 3500``` 3501 3502**Description** 3503 3504Draws a single character. If the typeface of the current font does not support the character to draw, the system typeface is used to draw the character. 3505 3506**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3507 3508**Since**: 12 3509 3510**Parameters** 3511 3512| Name| Description| 3513| -------- | -------- | 3514| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3515| str | Pointer to the single character to draw. A string can be passed in, but only the first character in the string is parsed and drawn in UTF-8 encoding.| 3516| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 3517| x | X coordinate of the left point of the character baseline.| 3518| y | Y coordinate of the left point of the character baseline.| 3519 3520**Returns** 3521 3522Returns one of the following result codes: 3523- **OH_DRAWING_SUCCESS** if the operation is successful. 3524- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, or **font** is NULL, or the length of **str** is **0**. 3525 3526 3527 3528### OH_Drawing_FontMeasureSingleCharacter() 3529 3530``` 3531OH_Drawing_ErrorCode OH_Drawing_FontMeasureSingleCharacter (const OH_Drawing_Font* font, const char* str, float* textWidth ) 3532``` 3533 3534**Description** 3535 3536Measures the width of a single character. If the typeface of the current font does not support the character to measure, the system typeface is used to measure the character width. 3537 3538**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3539 3540**Since**: 12 3541 3542**Parameters** 3543 3544| Name| Description| 3545| -------- | -------- | 3546| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 3547| str | Pointer to the single character to measure. A string can be passed in, but only the first character in the string is parsed and measured in UTF-8 encoding.| 3548| textWidth | Pointer to the character width obtained.| 3549 3550**Returns** 3551 3552Returns one of the following result codes: 3553- **OH_DRAWING_SUCCESS** if the operation is successful. 3554- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **str**, or **textWidth** is NULL, or the length of **str** is **0**. 3555 3556 3557 3558### OH_Drawing_TypographyPaintOnPath() 3559 3560``` 3561void OH_Drawing_TypographyPaintOnPath (OH_Drawing_Typography* , OH_Drawing_Canvas* , OH_Drawing_Path* , double , double ) 3562``` 3563 3564**Description** 3565 3566Draws text along a path. 3567 3568**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3569 3570**Since**: 12 3571 3572**Parameters** 3573 3574| Name| Description| 3575| -------- | -------- | 3576| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography).| 3577| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object, which is obtained by calling [OH_Drawing_CanvasCreate](#oh_drawing_canvascreate).| 3578| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object, which is obtained by calling [OH_Drawing_PathCreate](#oh_drawing_pathcreate).| 3579| double | Horizontal offset along the path direction. A positive number indicates a position that is ahead along the path from its start point, and a negative number indicates a position that is behind from the start point.| 3580| double | Vertical offset along the path direction. A positive number indicates a position on the left side of the path, and a negative number indicates a position on the right side of the path.| 3581 3582 3583### OH_Drawing_RoundRectOffset() 3584 3585``` 3586OH_Drawing_ErrorCode OH_Drawing_RoundRectOffset (OH_Drawing_RoundRect* roundRect, float dx, float dy ) 3587``` 3588 3589**Description** 3590 3591Translates a rounded rectangle by an offset along the X axis and Y axis. 3592 3593**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3594 3595**Since**: 12 3596 3597**Parameters** 3598 3599| Name| Description| 3600| -------- | -------- | 3601| roundRect | Pointer to an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) object.| 3602| dx | X offset.| 3603| dy | Y offset.| 3604 3605**Returns** 3606 3607Returns one of the following result codes: 3608- **OH_DRAWING_SUCCESS** if the operation is successful. 3609- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **roundRect** is NULL. 3610 3611 3612### OH_Drawing_PointGetX() 3613 3614``` 3615OH_Drawing_ErrorCode OH_Drawing_PointGetX (const OH_Drawing_Point* point, float* x ) 3616``` 3617 3618**Description** 3619 3620Obtains the X coordinate of a point. 3621 3622**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3623 3624**Since**: 12 3625 3626**Parameters** 3627 3628| Name| Description| 3629| -------- | -------- | 3630| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.| 3631| x | Pointer to the X coordinate.| 3632 3633**Returns** 3634 3635Returns one of the following result codes: 3636- **OH_DRAWING_SUCCESS** if the operation is successful. 3637- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **x** is NULL. 3638 3639 3640### OH_Drawing_PointGetY() 3641 3642``` 3643OH_Drawing_ErrorCode OH_Drawing_PointGetY (const OH_Drawing_Point* point, float* y ) 3644``` 3645 3646**Description** 3647 3648Obtains the Y coordinate of a point. 3649 3650**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3651 3652**Since**: 12 3653 3654**Parameters** 3655 3656| Name| Description| 3657| -------- | -------- | 3658| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.| 3659| y | Pointer to the Y coordinate.| 3660 3661**Returns** 3662 3663Returns one of the following result codes: 3664- **OH_DRAWING_SUCCESS** if the operation is successful. 3665- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **y** is NULL. 3666 3667 3668### OH_Drawing_PointSet() 3669 3670``` 3671OH_Drawing_ErrorCode OH_Drawing_PointSet (OH_Drawing_Point* point, float x, float y ) 3672``` 3673 3674**Description** 3675 3676Sets the X and Y coordinates of a point. 3677 3678**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3679 3680**Since**: 12 3681 3682**Parameters** 3683 3684| Name| Description| 3685| -------- | -------- | 3686| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.| 3687| x | Pointer to the X coordinate.| 3688| y | Pointer to the Y coordinate.| 3689 3690**Returns** 3691 3692Returns one of the following result codes: 3693- **OH_DRAWING_SUCCESS** if the operation is successful. 3694- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **point** is NULL. 3695 3696 3697### OH_Drawing_FontMeasureText() 3698 3699``` 3700OH_Drawing_ErrorCode OH_Drawing_FontMeasureText (const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, OH_Drawing_Rect* bounds, float* textWidth ) 3701``` 3702 3703**Description** 3704 3705Obtains the text width and bounding box. 3706 3707**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3708 3709**Since**: 12 3710 3711**Parameters** 3712 3713| Name| Description| 3714| -------- | -------- | 3715| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 3716| text | Pointer to the text.| 3717| byteLength | Length of the text, in bytes.| 3718| encoding | Encoding type of the text.| 3719| bounds | Pointer to the bounding box. The value can be NULL.| 3720| textWidth | Pointer to the text width.| 3721 3722**Returns** 3723 3724Returns one of the following result codes: 3725- **OH_DRAWING_SUCCESS** if the operation is successful. 3726- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **text**, and **textWidth** is NULL, or **byteLength** is **0**. 3727 3728 3729### OH_Drawing_CanvasClipRegion() 3730 3731``` 3732OH_Drawing_ErrorCode OH_Drawing_CanvasClipRegion (OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region, OH_Drawing_CanvasClipOp clipOp ) 3733``` 3734 3735**Description** 3736 3737Clips a rectangle. 3738 3739**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3740 3741**Since**: 12 3742 3743**Parameters** 3744 3745| Name| Description| 3746| -------- | -------- | 3747| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3748| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.| 3749| clipOp | Clip mode.| 3750 3751**Returns** 3752 3753Returns one of the following result codes: 3754- **OH_DRAWING_SUCCESS** if the operation is successful. 3755- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **region** is NULL. 3756- **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **clipOp** is not set to one of the enumerated values. 3757 3758 3759### OH_Drawing_CanvasDrawColor() 3760 3761``` 3762OH_Drawing_ErrorCode OH_Drawing_CanvasDrawColor (OH_Drawing_Canvas* canvas, uint32_t color, OH_Drawing_BlendMode blendMode ) 3763``` 3764 3765**Description** 3766 3767Fills the entire canvas with the specified color and blend mode. 3768 3769**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3770 3771**Since**: 12 3772 3773**Parameters** 3774 3775| Name| Description| 3776| -------- | -------- | 3777| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3778| color | Color.| 3779| blendMode | Blend mode.| 3780 3781**Returns** 3782 3783Returns one of the following result codes: 3784- **OH_DRAWING_SUCCESS** if the operation is successful. 3785- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas** is NULL. 3786- **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **blendMode** is not set to one of the enumerated values. 3787 3788 3789### OH_Drawing_CanvasGetImageInfo() 3790 3791``` 3792OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo (OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo ) 3793``` 3794 3795**Description** 3796 3797Obtains the image information of a canvas. 3798 3799**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3800 3801**Since**: 12 3802 3803**Parameters** 3804 3805| Name| Description| 3806| -------- | -------- | 3807| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3808| imageInfo | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 3809 3810**Returns** 3811 3812Returns one of the following result codes: 3813- **OH_DRAWING_SUCCESS** if the operation is successful. 3814- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **imageInfo** is NULL. 3815 3816 3817### OH_Drawing_CanvasIsClipEmpty() 3818 3819``` 3820OH_Drawing_ErrorCode OH_Drawing_CanvasIsClipEmpty (OH_Drawing_Canvas* canvas, bool* isClipEmpty ) 3821``` 3822 3823**Description** 3824 3825Checks whether the region that can be drawn is empty after cropping. 3826 3827**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3828 3829**Since**: 12 3830 3831**Parameters** 3832 3833| Name| Description| 3834| -------- | -------- | 3835| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3836| isClipEmpty | Pointer to the variable that specifies whether the region is empty. The value **true** means that the region is empty, and **false** means the opposite.| 3837 3838**Returns** 3839 3840Returns one of the following result codes: 3841- **OH_DRAWING_SUCCESS** if the operation is successful. 3842- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **isClipEmpty** is NULL. 3843 3844 3845### OH_Drawing_CanvasDrawPoint() 3846 3847``` 3848OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPoint (OH_Drawing_Canvas* canvas, const OH_Drawing_Point2D* point ) 3849``` 3850 3851**Description** 3852 3853Draws a point. 3854 3855**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3856 3857**Since**: 12 3858 3859**Parameters** 3860 3861| Name| Description| 3862| -------- | -------- | 3863| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 3864| point | Pointer to an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) object.| 3865 3866**Returns** 3867 3868Returns one of the following result codes: 3869- **OH_DRAWING_SUCCESS** if the operation is successful. 3870- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **point** is NULL. 3871 3872 3873### OH_Drawing_MatrixGetAll() 3874 3875``` 3876OH_Drawing_ErrorCode OH_Drawing_MatrixGetAll (OH_Drawing_Matrix* matrix, float value[9] ) 3877``` 3878 3879**Description** 3880 3881Obtains all element values of a matrix. 3882 3883**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3884 3885**Since**: 12 3886 3887**Parameters** 3888 3889| Name| Description| 3890| -------- | -------- | 3891| matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.| 3892| value | Array used to store the obtained element values.| 3893 3894**Returns** 3895 3896Returns one of the following result codes: 3897- **OH_DRAWING_SUCCESS** if all element values of the matrix are successfully obtained. 3898- **OH_DRAWING_ERROR_INVALID_PARAMETER** if the matrix element values fail to be obtained. The failure cause is that **matrix** or **value** is NULL. 3899 3900 3901 3902### OH_Drawing_ErrorCodeGet() 3903 3904``` 3905OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet () 3906``` 3907 3908**Description** 3909 3910Obtains the latest error code of the module. After the function is successfully executed, the error code returned by this function will not be modified. 3911 3912**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3913 3914**Since**: 12 3915 3916**Returns** 3917 3918Returns the enumerated values of the error code. 3919 3920### OH_Drawing_BrushCopy() 3921 3922``` 3923OH_Drawing_Brush* OH_Drawing_BrushCopy (OH_Drawing_Brush* brush) 3924``` 3925 3926**Description** 3927 3928Copies an existing [OH_Drawing_Brush](#oh_drawing_brush) object to create a new one. 3929 3930Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 3931 3932If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 3933 3934**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3935 3936**Since**: 12 3937 3938**Parameters** 3939 3940| Name| Description| 3941| -------- | -------- | 3942| brush | Pointer to an **OH_Drawing_Brush** object.| 3943 3944**Returns** 3945 3946Returns the pointer to the [OH_Drawing_Brush](#oh_drawing_brush) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **brush** is NULL. 3947 3948 3949 3950### OH_Drawing_FilterSetImageFilter() 3951 3952``` 3953void OH_Drawing_FilterSetImageFilter (OH_Drawing_Filter* , OH_Drawing_ImageFilter* ) 3954``` 3955 3956**Description** 3957 3958Sets an **OH_Drawing_ImageFilter** object for an **OH_Drawing_Filter** object. 3959 3960Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 3961 3962If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 3963 3964**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3965 3966**Since**: 12 3967 3968**Parameters** 3969 3970| Name| Description| 3971| -------- | -------- | 3972| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object.| 3973| OH_Drawing_ImageFilter | Pointer to an [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object. If NULL is passed in, the image filter effect of the object will be cleared.| 3974 3975 3976### OH_Drawing_ImageFilterCreateBlur() 3977 3978``` 3979OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur (float sigmaX, float sigmaY, OH_Drawing_TileMode , OH_Drawing_ImageFilter* input ) 3980``` 3981 3982**Description** 3983 3984Creates an **OH_Drawing_ImageFilter** object with a given blur type. 3985 3986**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 3987 3988**Since**: 12 3989 3990**Parameters** 3991 3992| Name| Description| 3993| -------- | -------- | 3994| sigmaX | Deviation of the Gaussian blur to apply along the X axis.| 3995| sigmaY | Deviation of the Gaussian blur to apply along the Y axis.| 3996| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).| 3997| input | Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image filter is directly applied to the original image.| 3998 3999**Returns** 4000 4001Returns the pointer to the [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available. 4002 4003 4004### OH_Drawing_ImageFilterCreateFromColorFilter() 4005 4006``` 4007OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter (OH_Drawing_ColorFilter* colorFilter, OH_Drawing_ImageFilter* input ) 4008``` 4009 4010**Description** 4011 4012Creates an **OH_Drawing_ImageFilter** object with a color filter effect. 4013 4014Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4015 4016If **colorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4017 4018**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4019 4020**Since**: 12 4021 4022**Parameters** 4023 4024| Name| Description| 4025| -------- | -------- | 4026| colorFilter | Pointer to an [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) object.| 4027| input | Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image filter is directly applied to the original image.| 4028 4029**Returns** 4030 4031Returns the pointer to the [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **colorFilter** is NULL. 4032 4033 4034### OH_Drawing_ImageFilterDestroy() 4035 4036``` 4037void OH_Drawing_ImageFilterDestroy (OH_Drawing_ImageFilter* ) 4038``` 4039 4040**Description** 4041 4042Destroys an **OH_Drawing_ImageFilter** object and reclaims the memory occupied by the object. 4043 4044**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4045 4046**Since**: 12 4047 4048**Parameters** 4049 4050| Name| Description| 4051| -------- | -------- | 4052| OH_Drawing_ImageFilter | Pointer to an [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object.| 4053 4054 4055### OH_Drawing_MatrixMapPoints() 4056 4057``` 4058void OH_Drawing_MatrixMapPoints (const OH_Drawing_Matrix* , const OH_Drawing_Point2D* src, OH_Drawing_Point2D* dst, int count ) 4059``` 4060 4061**Description** 4062 4063Maps a source point array to a destination point array by means of matrix transformation. 4064 4065Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4066 4067If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4068 4069**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4070 4071**Since**: 12 4072 4073**Parameters** 4074 4075| Name| Description| 4076| -------- | -------- | 4077| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.| 4078| src | Array of source points.| 4079| dst | Array of destination points. The number of destination points must be the same as that of source points.| 4080| count | Number of source points or destination points.| 4081 4082 4083### OH_Drawing_MatrixMapRect() 4084 4085``` 4086bool OH_Drawing_MatrixMapRect (const OH_Drawing_Matrix* , const OH_Drawing_Rect* src, OH_Drawing_Rect* dst ) 4087``` 4088 4089**Description** 4090 4091Maps a rectangle to the smallest rectangle that can enclose the vertices to which the four source vertices are mapped by means of matrix transformation. 4092 4093Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4094 4095If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. 4096 4097**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4098 4099**Since**: 12 4100 4101**Parameters** 4102 4103| Name| Description| 4104| -------- | -------- | 4105| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.| 4106| src | Pointer to the source rectangle.| 4107| dst | Pointer to the destination rectangle.| 4108 4109**Returns** 4110 4111Returns **true** if the source rectangle is equal to the destination rectangle; returns **false** otherwise. 4112 4113 4114### OH_Drawing_PathAddPolygon() 4115 4116``` 4117void OH_Drawing_PathAddPolygon (OH_Drawing_Path* path, const OH_Drawing_Point2D* points, uint32_t count, bool isClosed ) 4118``` 4119 4120**Description** 4121 4122Adds a polygon to a path. 4123 4124Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4125 4126If either **path** or **points** is NULL or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4127 4128**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4129 4130**Since**: 12 4131 4132**Parameters** 4133 4134| Name| Description| 4135| -------- | -------- | 4136| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object.| 4137| points | Pointer to an array that holds the vertex coordinates of the polygon.| 4138| count | Size of the array.| 4139| isClosed | Whether the path is closed. The value **true** means that the path is closed, and **false** means the opposite.| 4140 4141 4142### OH_Drawing_PathAddCircle() 4143 4144``` 4145void OH_Drawing_PathAddCircle (OH_Drawing_Path* path, float x, float y, float radius, OH_Drawing_PathDirection ) 4146``` 4147 4148**Description** 4149 4150Adds a circle to a path in the specified direction. 4151 4152Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4153 4154If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4155 4156If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4157 4158If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4159 4160**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4161 4162**Since**: 12 4163 4164**Parameters** 4165 4166| Name| Description| 4167| -------- | -------- | 4168| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4169| x | X coordinate of the circle center.| 4170| y | Y coordinate of the circle center.| 4171| radius | Radius of the circle.| 4172| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection).| 4173 4174 4175### OH_Drawing_PathBuildFromSvgString() 4176 4177``` 4178bool OH_Drawing_PathBuildFromSvgString (OH_Drawing_Path* path, const char* str ) 4179``` 4180 4181**Description** 4182 4183Parses the path represented by an SVG string. 4184 4185Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4186 4187If either **path** or **str** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4188 4189**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4190 4191**Since**: 12 4192 4193**Parameters** 4194 4195| Name| Description| 4196| -------- | -------- | 4197| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4198| str | Pointer to the SVG string.| 4199 4200**Returns** 4201 4202Returns **true** if the SVG string is parsed successfully; returns **false** otherwise. 4203 4204 4205### OH_Drawing_PathGetBounds() 4206 4207``` 4208void OH_Drawing_PathGetBounds (OH_Drawing_Path* , OH_Drawing_Rect* ) 4209``` 4210 4211**Description** 4212 4213Obtains the minimum bounds that enclose a path. 4214 4215Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4216 4217If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4218 4219**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4220 4221**Since**: 12 4222 4223**Parameters** 4224 4225| Name| Description| 4226| -------- | -------- | 4227| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4228| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.| 4229 4230 4231### OH_Drawing_PathIsClosed() 4232 4233``` 4234bool OH_Drawing_PathIsClosed (OH_Drawing_Path* path, bool forceClosed ) 4235``` 4236 4237**Description** 4238 4239Checks whether a path is closed. 4240 4241Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4242 4243If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4244 4245**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4246 4247**Since**: 12 4248 4249**Parameters** 4250 4251| Name| Description| 4252| -------- | -------- | 4253| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4254| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.| 4255 4256**Returns** 4257 4258Returns **true** if the path is closed; returns **false** otherwise. 4259 4260 4261### OH_Drawing_PathGetPositionTangent() 4262 4263``` 4264bool OH_Drawing_PathGetPositionTangent (OH_Drawing_Path* path, bool forceClosed, float distance, OH_Drawing_Point2D* position, OH_Drawing_Point2D* tangent ) 4265``` 4266 4267**Description** 4268 4269Obtains the coordinates and tangent at a distance from the start point of a path. 4270 4271Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4272 4273If any of **path**, **position**, or **tangent** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4274 4275**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4276 4277**Since**: 12 4278 4279**Parameters** 4280 4281| Name| Description| 4282| -------- | -------- | 4283| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4284| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.| 4285| distance | Distance from the start point.| 4286| position | Pointer to the coordinates.| 4287| tangent | Pointer to the tangent.| 4288 4289**Returns** 4290 4291Returns **true** if the operation is successful; returns **false** otherwise. 4292 4293 4294### OH_Drawing_PathOp() 4295 4296``` 4297bool OH_Drawing_PathOp (OH_Drawing_Path* path, const OH_Drawing_Path* other, OH_Drawing_PathOpMode op ) 4298``` 4299 4300**Description** 4301 4302Combines two paths based on the specified operation mode. 4303 4304Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4305 4306If either **path** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4307 4308If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4309 4310**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4311 4312**Since**: 12 4313 4314**Parameters** 4315 4316| Name| Description| 4317| -------- | -------- | 4318| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object, in which the resulting path is saved.| 4319| other | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4320| op | Operation mode of the path. For details about the available options, see [OH_Drawing_PathOpMode](#oh_drawing_pathopmode).| 4321 4322**Returns** 4323 4324Returns **true** if the resulting path is not empty; returns **false** otherwise. 4325 4326 4327### OH_Drawing_PathGetMatrix() 4328 4329``` 4330bool OH_Drawing_PathGetMatrix (OH_Drawing_Path* path, bool forceClosed, float distance, OH_Drawing_Matrix* matrix, OH_Drawing_PathMeasureMatrixFlags flag ) 4331``` 4332 4333**Description** 4334 4335Obtains a transformation matrix at a distance from the start point of a path. 4336 4337Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4338 4339If either **path** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4340 4341If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4342 4343**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4344 4345**Since**: 12 4346 4347**Parameters** 4348 4349| Name| Description| 4350| -------- | -------- | 4351| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4352| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.| 4353| distance | Distance from the start point.| 4354| matrix | Pointer to the transformation matrix.| 4355| flag | Type of the matrix information. For details about the available options, see [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags).| 4356 4357**Returns** 4358 4359Returns **true** if the transformation matrix is obtained successfully; returns **false** otherwise. The possible failure cause is that **path** is NULL or the path length is 0. 4360 4361 4362### OH_Drawing_PenGetFillPath() 4363 4364``` 4365bool OH_Drawing_PenGetFillPath (OH_Drawing_Pen* , const OH_Drawing_Path* src, OH_Drawing_Path* dst, const OH_Drawing_Rect* , const OH_Drawing_Matrix* ) 4366``` 4367 4368**Description** 4369 4370Obtains the source path outline drawn using a pen and represents it using a destination path. 4371 4372Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4373 4374If any of **OH_Drawing_Pen**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4375 4376**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4377 4378**Since**: 12 4379 4380**Parameters** 4381 4382| Name| Description| 4383| -------- | -------- | 4384| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.| 4385| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object.| 4386| dst | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object.| 4387| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. NULL is recommended.| 4388| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. NULL is recommended. The default value is an identity matrix.| 4389 4390**Returns** 4391 4392Returns **true** if the destination path is obtained; returns **false** otherwise. 4393 4394 4395### OH_Drawing_PenCopy() 4396 4397``` 4398OH_Drawing_Pen* OH_Drawing_PenCopy (OH_Drawing_Pen* pen) 4399``` 4400 4401**Description** 4402 4403Copies an existing [OH_Drawing_Pen](#oh_drawing_pen) object to create a new one. 4404 4405Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4406 4407If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4408 4409**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4410 4411**Since**: 12 4412 4413**Parameters** 4414 4415| Name| Description| 4416| -------- | -------- | 4417| pen | Pointer to an **OH_Drawing_Pen** object.| 4418 4419**Returns** 4420 4421Returns the pointer to the [OH_Drawing_Pen](#oh_drawing_pen) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **pen** is NULL. 4422 4423 4424### OH_Drawing_PixelMapGetFromNativePixelMap() 4425 4426``` 4427OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromNativePixelMap (NativePixelMap_* ) 4428``` 4429 4430**Description** 4431 4432Obtains the pixel map defined by this module from a pixel map defined by the image framework. 4433 4434**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4435 4436**Since**: 12 4437 4438**Parameters** 4439 4440| Name| Description| 4441| -------- | -------- | 4442| NativePixelMap_ | Pointer to a **NativePixelMap_** object, which is the pixel map defined by the image framework.| 4443 4444**Returns** 4445 4446Returns the pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object, which is the pixel map defined by this module. If NULL is returned, the creation fails. The possible failure cause is that **NativePixelMap_** is NULL. 4447 4448 4449### OH_Drawing_PixelMapGetFromOhPixelMapNative() 4450 4451``` 4452OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromOhPixelMapNative (OH_PixelmapNative* ) 4453``` 4454 4455**Description** 4456 4457Obtains the pixel map defined by this module from a pixel map defined by the image framework. 4458 4459**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4460 4461**Since**: 12 4462 4463**Parameters** 4464 4465| Name| Description| 4466| -------- | -------- | 4467| OH_PixelmapNative | Pointer to an **OH_PixelmapNative** object, which is the pixel map defined by the image framework.| 4468 4469**Returns** 4470 4471Returns the pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object, which is the pixel map defined by this module. If NULL is returned, the creation fails. The possible failure cause is that **OH_PixelmapNative** is NULL. 4472 4473 4474### OH_Drawing_PixelMapDissolve() 4475 4476``` 4477void OH_Drawing_PixelMapDissolve (OH_Drawing_PixelMap* ) 4478``` 4479 4480**Description** 4481 4482Removes the relationship between a pixel map defined by this module and a pixel map defined by the image framework. The relationship is established by calling [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) or [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative). 4483 4484**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4485 4486**Since**: 12 4487 4488**Parameters** 4489 4490| Name| Description| 4491| -------- | -------- | 4492| OH_Drawing_PixelMap | Pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object.| 4493 4494 4495### OH_Drawing_RectJoin() 4496 4497``` 4498bool OH_Drawing_RectJoin (OH_Drawing_Rect* rect, const OH_Drawing_Rect* other ) 4499``` 4500 4501**Description** 4502 4503Obtains the union of two rectangles. 4504 4505Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4506 4507If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4508 4509**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4510 4511**Since**: 12 4512 4513**Parameters** 4514 4515| Name| Description| 4516| -------- | -------- | 4517| rect | Pointer to an **OH_Drawing_Rect** object.| 4518| other | Pointer to an **OH_Drawing_Rect** object.| 4519 4520**Returns** 4521 4522Returns **true** if the union is obtained; returns **false** otherwise. The possible failure cause is that at least one of the parameters **rect** and **other** is NULL or the size of the rectangle specified by **other** is empty. 4523 4524 4525### OH_Drawing_RegionContains() 4526 4527``` 4528bool OH_Drawing_RegionContains (OH_Drawing_Region* region, int32_t x, int32_t y ) 4529``` 4530 4531**Description** 4532 4533Checks whether a region contains the specified point. 4534 4535Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4536 4537If **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4538 4539**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4540 4541**Since**: 12 4542 4543**Parameters** 4544 4545| Name| Description| 4546| -------- | -------- | 4547| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.| 4548| int32_t | X coordinate of the point.| 4549| int32_t | Y coordinate of the point.| 4550 4551**Returns** 4552 4553Returns **true** if the region contains the specified point; returns **false** otherwise. 4554 4555 4556### OH_Drawing_RegionOp() 4557 4558``` 4559bool OH_Drawing_RegionOp (OH_Drawing_Region* region, const OH_Drawing_Region* other, OH_Drawing_RegionOpMode op ) 4560``` 4561 4562**Description** 4563 4564Combines two regions based on the specified operation mode. 4565 4566Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4567 4568If either **region** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4569 4570If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4571 4572**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4573 4574**Since**: 12 4575 4576**Parameters** 4577 4578| Name| Description| 4579| -------- | -------- | 4580| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object, in which the resulting region is saved.| 4581| other | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.| 4582| op | Operation mode of the region. For details about the available options, see [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode).| 4583 4584**Returns** 4585 4586Returns **true** if the resulting region is not empty; returns false otherwise. 4587 4588 4589### OH_Drawing_RegionSetPath() 4590 4591``` 4592bool OH_Drawing_RegionSetPath (OH_Drawing_Region* region, const OH_Drawing_Path* path, const OH_Drawing_Region* clip ) 4593``` 4594 4595**Description** 4596 4597Sets a region to the area described by the path. 4598 4599Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4600 4601If **region**, **path**, or **clip** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4602 4603**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4604 4605**Since**: 12 4606 4607**Parameters** 4608 4609| Name| Description| 4610| -------- | -------- | 4611| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.| 4612| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.| 4613| clip | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.| 4614 4615**Returns** 4616 4617Returns **true** if the resulting region is not empty; returns false otherwise. 4618 4619 4620### OH_Drawing_ShaderEffectCreateColorShader() 4621 4622``` 4623OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateColorShader (const uint32_t color) 4624``` 4625 4626**Description** 4627 4628Creates an **OH_Drawing_ShaderEffect** object with a single color. 4629 4630**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4631 4632**Since**: 12 4633 4634**Parameters** 4635 4636| Name| Description| 4637| -------- | -------- | 4638| color | Color of the shader.| 4639 4640**Returns** 4641 4642Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available. 4643 4644 4645### OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix() 4646 4647``` 4648OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix (const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix* ) 4649``` 4650 4651**Description** 4652 4653Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points. 4654 4655Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4656 4657If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4658 4659If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4660 4661**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4662 4663**Since**: 12 4664 4665**Parameters** 4666 4667| Name| Description| 4668| -------- | -------- | 4669| startPt | Start point.| 4670| endPt | End point.| 4671| colors | Colors to distribute between the two points.| 4672| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start point and end point.| 4673| size | Number of colors and positions (if **pos** is not NULL).| 4674| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).| 4675| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.| 4676 4677**Returns** 4678 4679Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **startPt**, **endPt**, and **colors** is NULL. 4680 4681 4682### OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix() 4683 4684``` 4685OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix (const OH_Drawing_Point2D* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix* ) 4686``` 4687 4688**Description** 4689 4690Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner. 4691 4692Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4693 4694If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4695 4696If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4697 4698**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4699 4700**Since**: 12 4701 4702**Parameters** 4703 4704| Name| Description| 4705| -------- | -------- | 4706| centerPt | Center of the circle.| 4707| radius | Radius of the gradient.| 4708| colors | Colors to distribute in the radial direction.| 4709| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed in the radial direction.| 4710| size | Number of colors and positions (if **pos** is not NULL).| 4711| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).| 4712| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.| 4713 4714**Returns** 4715 4716Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **centerPt** and **colors** is NULL. 4717 4718 4719### OH_Drawing_ShaderEffectCreateTwoPointConicalGradient() 4720 4721``` 4722OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateTwoPointConicalGradient (const OH_Drawing_Point2D* startPt, float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix* ) 4723``` 4724 4725**Description** 4726 4727Creates an **OH_Drawing_ShaderEffect** object that generates a gradient between two given circles. 4728 4729Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4730 4731If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4732 4733If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4734 4735**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4736 4737**Since**: 12 4738 4739**Parameters** 4740 4741| Name| Description| 4742| -------- | -------- | 4743| startPt | Pointer to the center of the start circle.| 4744| startRadius | Radius of the start circle.| 4745| endPt | Pointer to the center of the end circle.| 4746| endRadius | Radius of the end circle.| 4747| colors | Colors to distribute between the two circles.| 4748| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the two circles.| 4749| size | Number of colors and positions (if **pos** is not NULL).| 4750| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1).| 4751| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.| 4752 4753**Returns** 4754 4755Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **startPt**, **endPt**, and **colors** is NULL. 4756 4757 4758 4759### OH_Drawing_TextBlobUniqueID() 4760 4761``` 4762uint32_t OH_Drawing_TextBlobUniqueID (const OH_Drawing_TextBlob* ) 4763``` 4764 4765**Description** 4766 4767Obtains the unique identifier of a text blob. The identifier is a non-zero value. 4768 4769Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4770 4771If **OH_Drawing_TextBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4772 4773**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4774 4775**Since**: 12 4776 4777**Parameters** 4778 4779| Name| Description| 4780| -------- | -------- | 4781| OH_Drawing_TextBlob | Pointer to an [OH_Drawing_TextBlob](#oh_drawing_textblob) object.| 4782 4783**Returns** 4784 4785Returns the unique identifier of the text blob. 4786 4787 4788### OH_Drawing_PenSetShadowLayer() 4789 4790``` 4791void OH_Drawing_PenSetShadowLayer (OH_Drawing_Pen* , OH_Drawing_ShadowLayer* ) 4792``` 4793 4794**Description** 4795 4796Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn. 4797 4798Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4799 4800If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4801 4802**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4803 4804**Since**: 12 4805 4806**Parameters** 4807 4808| Name| Description| 4809| -------- | -------- | 4810| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.| 4811| OH_Drawing_ShadowLayer | Pointer to an [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) object. If NULL is passed in, the shadow layer effect will be cleared.| 4812 4813 4814### OH_Drawing_BrushSetShadowLayer() 4815 4816``` 4817void OH_Drawing_BrushSetShadowLayer (OH_Drawing_Brush* , OH_Drawing_ShadowLayer* ) 4818``` 4819 4820**Description** 4821 4822Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn. 4823 4824Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4825 4826If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4827 4828**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4829 4830**Since**: 12 4831 4832**Parameters** 4833 4834| Name| Description| 4835| -------- | -------- | 4836| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 4837| OH_Drawing_ShadowLayer | Pointer to an **OH_Drawing_ShadowLayer** object. If NULL is passed in, the shadow layer effect of the brush will be cleared.| 4838 4839 4840### OH_Drawing_ShadowLayerCreate() 4841 4842``` 4843OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate (float blurRadius, float x, float y, uint32_t color ) 4844``` 4845 4846**Description** 4847 4848Creates an **OH_Drawing_ShadowLayer** object. 4849 4850Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4851 4852If **blurRadius** is less than or equal to **0**, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4853 4854**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4855 4856**Since**: 12 4857 4858**Parameters** 4859 4860| Name| Description| 4861| -------- | -------- | 4862| blurRadius | Radius of the shadow layer. The value must be greater than 0.| 4863| x | Offset on the X axis.| 4864| y | Offset on the Y axis.| 4865| color | Color of the shadow.| 4866 4867**Returns** 4868 4869Returns the pointer to the **OH_Drawing_ShadowLayer** object created. 4870 4871 4872### OH_Drawing_ShadowLayerDestroy() 4873 4874``` 4875void OH_Drawing_ShadowLayerDestroy (OH_Drawing_ShadowLayer* ) 4876``` 4877 4878**Description** 4879 4880Destroys an **OH_Drawing_ShadowLayer** object and reclaims the memory occupied by the object. 4881 4882**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4883 4884**Since**: 12 4885 4886**Parameters** 4887 4888| Name| Description| 4889| -------- | -------- | 4890| OH_Drawing_ShadowLayer | Pointer to the shadow layer.| 4891 4892 4893### OH_Drawing_FontSetBaselineSnap() 4894 4895``` 4896void OH_Drawing_FontSetBaselineSnap (OH_Drawing_Font* , bool baselineSnap ) 4897``` 4898 4899**Description** 4900 4901Sets whether to request that baselines be snapped to pixels when the current canvas matrix is axis aligned. 4902 4903Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4904 4905If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4906 4907**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4908 4909**Since**: 12 4910 4911**Parameters** 4912 4913| Name| Description| 4914| -------- | -------- | 4915| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 4916| baselineSnap | Whether to request that baselines be snapped to pixels. The value **true** means to request that baselines be snapped to pixels, and **false** means the opposite.| 4917 4918 4919### OH_Drawing_FontIsBaselineSnap() 4920 4921``` 4922bool OH_Drawing_FontIsBaselineSnap (const OH_Drawing_Font* ) 4923``` 4924 4925**Description** 4926 4927Checks whether baselines are requested to be snapped to pixels when the current canvas matrix is axis aligned. 4928 4929Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4930 4931If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4932 4933**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4934 4935**Since**: 12 4936 4937**Parameters** 4938 4939| Name| Description| 4940| -------- | -------- | 4941| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 4942 4943**Returns** 4944 4945Returns **true** if baselines are requested to be snapped to pixels when the current canvas matrix is axis aligned; returns **false** otherwise. 4946 4947 4948### OH_Drawing_FontSetEdging() 4949 4950``` 4951void OH_Drawing_FontSetEdging (OH_Drawing_Font* , OH_Drawing_FontEdging ) 4952``` 4953 4954**Description** 4955 4956Sets a font edging effect. 4957 4958Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4959 4960If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4961 4962If **OH_Drawing_FontEdging** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 4963 4964**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4965 4966**Since**: 12 4967 4968**Parameters** 4969 4970| Name| Description| 4971| -------- | -------- | 4972| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 4973| OH_Drawing_FontEdging | Font edging effect.| 4974 4975 4976### OH_Drawing_FontGetEdging() 4977 4978``` 4979OH_Drawing_FontEdging OH_Drawing_FontGetEdging (const OH_Drawing_Font* ) 4980``` 4981 4982**Description** 4983 4984Obtains the font edging effect. 4985 4986Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 4987 4988If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 4989 4990**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 4991 4992**Since**: 12 4993 4994**Parameters** 4995 4996| Name| Description| 4997| -------- | -------- | 4998| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 4999 5000**Returns** 5001 5002Returns the font edging effect. 5003 5004 5005 5006### OH_Drawing_FontSetForceAutoHinting() 5007 5008``` 5009void OH_Drawing_FontSetForceAutoHinting (OH_Drawing_Font* , bool isForceAutoHinting ) 5010``` 5011 5012**Description** 5013 5014Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs. 5015 5016Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5017 5018If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5019 5020**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5021 5022**Since**: 12 5023 5024**Parameters** 5025 5026| Name| Description| 5027| -------- | -------- | 5028| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5029| isForceAutoHinting | Whether to forcibly use auto hinting. The value **true** means to forcibly use auto hinting, and **false** means the opposite.| 5030 5031 5032### OH_Drawing_FontIsForceAutoHinting() 5033 5034``` 5035bool OH_Drawing_FontIsForceAutoHinting (const OH_Drawing_Font* ) 5036``` 5037 5038**Description** 5039 5040Checks whether auto hinting is forcibly used. 5041 5042Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5043 5044If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5045 5046**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5047 5048**Since**: 12 5049 5050**Parameters** 5051 5052| Name| Description| 5053| -------- | -------- | 5054| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5055 5056**Returns** 5057 5058Returns **true** if auto hinting is forcibly used; returns **false** otherwise. 5059 5060 5061### OH_Drawing_FontSetSubpixel() 5062 5063``` 5064void OH_Drawing_FontSetSubpixel (OH_Drawing_Font* , bool isSubpixel ) 5065``` 5066 5067**Description** 5068 5069Sets whether to use sub-pixel rendering for a font. 5070 5071Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5072 5073If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5074 5075**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5076 5077**Since**: 12 5078 5079**Parameters** 5080 5081| Name| Description| 5082| -------- | -------- | 5083| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5084| isSubpixel | Whether to use sub-pixel rendering for the font. The value **true** means to use sub-pixel rendering for the font, and **false** means the opposite.| 5085 5086 5087### OH_Drawing_FontIsSubpixel() 5088 5089``` 5090bool OH_Drawing_FontIsSubpixel (const OH_Drawing_Font* ) 5091``` 5092 5093**Description** 5094 5095Checks whether sub-pixel rendering is used for a font. 5096 5097Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5098 5099If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5100 5101**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5102 5103**Since**: 12 5104 5105**Parameters** 5106 5107| Name| Description| 5108| -------- | -------- | 5109| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5110 5111**Returns** 5112 5113Returns **true** if sub-pixel rendering is used for the font; returns **false** otherwise. 5114 5115 5116### OH_Drawing_FontGetTextSize() 5117 5118``` 5119float OH_Drawing_FontGetTextSize (const OH_Drawing_Font* ) 5120``` 5121 5122**Description** 5123 5124Obtains the text size. 5125 5126Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5127 5128If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5129 5130**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5131 5132**Since**: 12 5133 5134**Parameters** 5135 5136| Name| Description| 5137| -------- | -------- | 5138| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5139 5140**Returns** 5141 5142Returns a floating point number representing the text size. 5143 5144 5145### OH_Drawing_FontTextToGlyphs() 5146 5147``` 5148uint32_t OH_Drawing_FontTextToGlyphs (const OH_Drawing_Font* , const void* text, uint32_t byteLength, OH_Drawing_TextEncoding encoding, uint16_t* glyphs, int maxGlyphCount ) 5149``` 5150 5151**Description** 5152 5153Converts text into glyph indices. 5154 5155Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5156 5157If any of **OH_Drawing_Font**, **text**, and **glyphs** is NULL, **byteLength** is **0**, or **maxGlyphCount** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5158 5159**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5160 5161**Since**: 12 5162 5163**Parameters** 5164 5165| Name| Description| 5166| -------- | -------- | 5167| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5168| text | Pointer to the start address of the storage.| 5169| byteLength | Text length, in bytes.| 5170| encoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding).| 5171| glyphs | Pointer to the start address for storing the glyph indices.| 5172| maxGlyphCount | Maximum number of glyphs.| 5173 5174**Returns** 5175 5176Returns the number of glyph indices. 5177 5178 5179### OH_Drawing_FontGetWidths() 5180 5181``` 5182void OH_Drawing_FontGetWidths (const OH_Drawing_Font* , const uint16_t* glyphs, int count, float* widths ) 5183``` 5184 5185**Description** 5186 5187Obtains the width of each glyph in a string of text. 5188 5189Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5190 5191If any of **OH_Drawing_Font**, **glyphs**, and **widths** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5192 5193**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5194 5195**Since**: 12 5196 5197**Parameters** 5198 5199| Name| Description| 5200| -------- | -------- | 5201| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5202| glyphs | Pointer to the start address for storing the glyph indices.| 5203| count | Number of glyph indices.| 5204| widths | Pointer to the start address for storing the glyph widths.| 5205 5206 5207### OH_Drawing_FontIsLinearText() 5208 5209``` 5210bool OH_Drawing_FontIsLinearText (const OH_Drawing_Font* ) 5211``` 5212 5213**Description** 5214 5215Checks whether linear scaling is used for a font. 5216 5217Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5218 5219If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5220 5221**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5222 5223**Since**: 12 5224 5225**Parameters** 5226 5227| Name| Description| 5228| -------- | -------- | 5229| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5230 5231**Returns** 5232 5233Returns **true** if linear scaling is used; returns **false** otherwise. 5234 5235 5236### OH_Drawing_FontGetTextSkewX() 5237 5238``` 5239float OH_Drawing_FontGetTextSkewX (const OH_Drawing_Font* ) 5240``` 5241 5242**Description** 5243 5244Obtains the horizontal skew factor of a font. 5245 5246Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5247 5248If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5249 5250**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5251 5252**Since**: 12 5253 5254**Parameters** 5255 5256| Name| Description| 5257| -------- | -------- | 5258| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5259 5260**Returns** 5261 5262Returns a floating point number representing the horizontal skew factor. 5263 5264 5265### OH_Drawing_FontIsFakeBoldText() 5266 5267``` 5268bool OH_Drawing_FontIsFakeBoldText (const OH_Drawing_Font* ) 5269``` 5270 5271**Description** 5272 5273Checks whether fake bold is used for a font. 5274 5275Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5276 5277If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5278 5279**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5280 5281**Since**: 12 5282 5283**Parameters** 5284 5285| Name| Description| 5286| -------- | -------- | 5287| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5288 5289**Returns** 5290 5291Returns **true** if fake bold is used; returns **false** otherwise. 5292 5293 5294### OH_Drawing_FontSetScaleX() 5295 5296``` 5297void OH_Drawing_FontSetScaleX (OH_Drawing_Font* , float scaleX ) 5298``` 5299 5300**Description** 5301 5302Sets a horizontal scale factor for a font. 5303 5304Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5305 5306If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5307 5308**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5309 5310**Since**: 12 5311 5312**Parameters** 5313 5314| Name| Description| 5315| -------- | -------- | 5316| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5317| scaleX | Horizontal scale factor.| 5318 5319 5320### OH_Drawing_FontGetScaleX() 5321 5322``` 5323float OH_Drawing_FontGetScaleX (const OH_Drawing_Font* ) 5324``` 5325 5326**Description** 5327 5328Obtains the horizontal scale factor of a font. 5329 5330Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5331 5332If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5333 5334**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5335 5336**Since**: 12 5337 5338**Parameters** 5339 5340| Name| Description| 5341| -------- | -------- | 5342| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5343 5344**Returns** 5345 5346Returns the horizontal scale factor. 5347 5348 5349### OH_Drawing_FontSetHinting() 5350 5351``` 5352void OH_Drawing_FontSetHinting (OH_Drawing_Font* , OH_Drawing_FontHinting ) 5353``` 5354 5355**Description** 5356 5357Sets a font hinting effect. 5358 5359Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5360 5361If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5362 5363If **OH_Drawing_FontHinting** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 5364 5365**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5366 5367**Since**: 12 5368 5369**Parameters** 5370 5371| Name| Description| 5372| -------- | -------- | 5373| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5374| OH_Drawing_FontHinting | Font hinting effect. For details about the available options, see [OH_Drawing_FontHinting](#oh_drawing_fonthinting).| 5375 5376 5377### OH_Drawing_FontGetHinting() 5378 5379``` 5380OH_Drawing_FontHinting OH_Drawing_FontGetHinting (const OH_Drawing_Font* ) 5381``` 5382 5383**Description** 5384 5385Obtains the font hinting effect. 5386 5387Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5388 5389If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5390 5391**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5392 5393**Since**: 12 5394 5395**Parameters** 5396 5397| Name| Description| 5398| -------- | -------- | 5399| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5400 5401**Returns** 5402 5403Returns the font hinting effect. For details about the available options, see [OH_Drawing_FontHinting](#oh_drawing_fonthinting). 5404 5405 5406### OH_Drawing_FontSetEmbeddedBitmaps() 5407 5408``` 5409void OH_Drawing_FontSetEmbeddedBitmaps (OH_Drawing_Font* , bool isEmbeddedBitmaps ) 5410``` 5411 5412**Description** 5413 5414Sets whether to use bitmaps in a font. 5415 5416Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5417 5418If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5419 5420**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5421 5422**Since**: 12 5423 5424**Parameters** 5425 5426| Name| Description| 5427| -------- | -------- | 5428| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5429| isEmbeddedBitmaps | Whether to use bitmaps in the font. The value **true** means to use bitmaps in the font, and **false** means the opposite.| 5430 5431 5432### OH_Drawing_FontIsEmbeddedBitmaps() 5433 5434``` 5435bool OH_Drawing_FontIsEmbeddedBitmaps (const OH_Drawing_Font* ) 5436``` 5437 5438**Description** 5439 5440Checks whether bitmaps are used in a font. 5441 5442Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5443 5444If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5445 5446**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5447 5448**Since**: 12 5449 5450**Parameters** 5451 5452| Name| Description| 5453| -------- | -------- | 5454| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.| 5455 5456**Returns** 5457 5458Returns **true** if bitmaps are used; returns **false** otherwise. 5459 5460 5461### OH_Drawing_BitmapBuild() 5462 5463``` 5464void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap* , const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat* ) 5465``` 5466 5467**Description** 5468 5469Initializes the width and height of a bitmap and sets the pixel format for the bitmap. 5470 5471Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5472 5473If either **OH_Drawing_Bitmap** or **OH_Drawing_BitmapFormat** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5474 5475**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5476 5477**Since**: 8 5478 5479**Parameters** 5480 5481| Name| Description| 5482| -------- | -------- | 5483| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5484| width | Width of the bitmap to be initialized.| 5485| height | Height of the bitmap to be initialized.| 5486| [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | Pointer to the pixel format of the bitmap to be initialized, including the pixel color type and alpha type.| 5487 5488 5489### OH_Drawing_BitmapCreate() 5490 5491``` 5492OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void ) 5493``` 5494 5495**Description** 5496 5497Creates an **OH_Drawing_Bitmap** object. 5498 5499**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5500 5501**Since**: 8 5502 5503**Returns** 5504 5505Returns the pointer to the **OH_Drawing_Bitmap** object created. 5506 5507 5508### OH_Drawing_BitmapCreateFromPixels() 5509 5510``` 5511OH_Drawing_Bitmap* OH_Drawing_BitmapCreateFromPixels (OH_Drawing_Image_Info* , void* pixels, uint32_t rowBytes ) 5512``` 5513 5514**Description** 5515 5516Creates an **OH_Drawing_Bitmap** object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for. 5517 5518Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5519 5520If either **OH_Drawing_Image_Info** or **pixels** is NULL or **rowBytes** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5521 5522**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5523 5524**Since**: 12 5525 5526**Parameters** 5527 5528| Name| Description| 5529| -------- | -------- | 5530| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 5531| pixels | Pointer to the start address of the memory for storing the bitmap pixels. You need to apply for the memory and ensure its validity.| 5532| rowBytes | Size of pixels per row.| 5533 5534**Returns** 5535 5536Returns the pointer to the [OH_Drawing_Bitmap](#oh_drawing_bitmap) object created. 5537 5538 5539### OH_Drawing_BitmapDestroy() 5540 5541``` 5542void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap* ) 5543``` 5544 5545**Description** 5546 5547Destroys an **OH_Drawing_Bitmap** object and reclaims the memory occupied by the object. 5548 5549**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5550 5551**Since**: 8 5552 5553**Parameters** 5554 5555| Name| Description| 5556| -------- | -------- | 5557| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5558 5559 5560### OH_Drawing_BitmapGetAlphaFormat() 5561 5562``` 5563OH_Drawing_AlphaFormat OH_Drawing_BitmapGetAlphaFormat (OH_Drawing_Bitmap* ) 5564``` 5565 5566**Description** 5567 5568Obtains the alpha component of a bitmap. 5569 5570Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5571 5572If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5573 5574**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5575 5576**Since**: 12 5577 5578**Parameters** 5579 5580| Name| Description| 5581| -------- | -------- | 5582| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5583 5584**Returns** 5585 5586Returns the alpha component. For details about the supported formats, see [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat). 5587 5588 5589### OH_Drawing_BitmapGetColorFormat() 5590 5591``` 5592OH_Drawing_ColorFormat OH_Drawing_BitmapGetColorFormat (OH_Drawing_Bitmap* ) 5593``` 5594 5595**Description** 5596 5597Obtains the pixel format of a bitmap. 5598 5599Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5600 5601If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5602 5603**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5604 5605**Since**: 12 5606 5607**Parameters** 5608 5609| Name| Description| 5610| -------- | -------- | 5611| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5612 5613**Returns** 5614 5615Returns the pixel format. For details about the supported formats, see [OH_Drawing_ColorFormat](#oh_drawing_colorformat). 5616 5617 5618### OH_Drawing_BitmapGetHeight() 5619 5620``` 5621uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap* ) 5622``` 5623 5624**Description** 5625 5626Obtains the height of a bitmap. 5627 5628Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5629 5630If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5631 5632**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5633 5634**Since**: 8 5635 5636**Parameters** 5637 5638| Name| Description| 5639| -------- | -------- | 5640| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5641 5642**Returns** 5643 5644Returns the height. 5645 5646 5647### OH_Drawing_BitmapGetImageInfo() 5648 5649``` 5650void OH_Drawing_BitmapGetImageInfo (OH_Drawing_Bitmap* , OH_Drawing_Image_Info* ) 5651``` 5652 5653**Description** 5654 5655Obtains the image information of a bitmap. 5656 5657Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5658 5659If either **OH_Drawing_Bitmap** or **OH_Drawing_Image_Info** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5660 5661**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5662 5663**Since**: 12 5664 5665**Parameters** 5666 5667| Name| Description| 5668| -------- | -------- | 5669| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.| 5670| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 5671 5672 5673### OH_Drawing_BitmapGetPixels() 5674 5675``` 5676void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap* ) 5677``` 5678 5679**Description** 5680 5681Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap. 5682 5683Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5684 5685If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5686 5687**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5688 5689**Since**: 8 5690 5691**Parameters** 5692 5693| Name| Description| 5694| -------- | -------- | 5695| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5696 5697**Returns** 5698 5699Returns the pixel address. 5700 5701 5702### OH_Drawing_BitmapGetWidth() 5703 5704``` 5705uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap* ) 5706``` 5707 5708**Description** 5709 5710Obtains the width of a bitmap. 5711 5712Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5713 5714If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5715 5716**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5717 5718**Since**: 8 5719 5720**Parameters** 5721 5722| Name| Description| 5723| -------- | -------- | 5724| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 5725 5726**Returns** 5727 5728Returns the width. 5729 5730### OH_Drawing_BitmapReadPixels() 5731 5732``` 5733bool OH_Drawing_BitmapReadPixels (OH_Drawing_Bitmap* , const OH_Drawing_Image_Info* dstInfo, void* dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY ) 5734``` 5735 5736**Description** 5737 5738Reads pixels of a rectangle in a bitmap to the specified buffer. 5739 5740Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5741 5742If any of **OH_Drawing_Bitmap**, **dstInfo**, and **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5743 5744**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5745 5746**Since**: 12 5747 5748**Parameters** 5749 5750| Name| Description| 5751| -------- | -------- | 5752| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.| 5753| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 5754| dstPixels | Pointer to the buffer for storing the pixels read.| 5755| dstRowBytes | Number of bytes in each row of the pixel data read. The value must be greater than or equal to the minimum number of bytes in each row in the [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 5756| srcX | Start X coordinate of the pixel data to read from the bitmap. The value must be less than the width of the bitmap.| 5757| srcY | Start Y coordinate of the pixel data to read from the bitmap. The value must be less than the height of the bitmap.| 5758 5759**Returns** 5760 5761Returns **true** if the pixels are read; returns **false** otherwise. 5762 5763 5764### OH_Drawing_BrushCreate() 5765 5766``` 5767OH_Drawing_Brush* OH_Drawing_BrushCreate (void ) 5768``` 5769 5770**Description** 5771 5772Creates an **OH_Drawing_Brush** object. 5773 5774**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5775 5776**Since**: 8 5777 5778**Returns** 5779 5780Returns the pointer to the **OH_Drawing_Brush** object created. 5781 5782 5783### OH_Drawing_BrushDestroy() 5784 5785``` 5786void OH_Drawing_BrushDestroy (OH_Drawing_Brush* ) 5787``` 5788 5789**Description** 5790 5791Destroys an **OH_Drawing_Brush** object and reclaims the memory occupied by the object. 5792 5793**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5794 5795**Since**: 8 5796 5797**Parameters** 5798 5799| Name| Description| 5800| -------- | -------- | 5801| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5802 5803 5804### OH_Drawing_BrushGetAlpha() 5805 5806``` 5807uint8_t OH_Drawing_BrushGetAlpha (const OH_Drawing_Brush* ) 5808``` 5809 5810**Description** 5811 5812Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape. 5813 5814Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5815 5816If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5817 5818**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5819 5820**Since**: 11 5821 5822**Parameters** 5823 5824| Name| Description| 5825| -------- | -------- | 5826| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5827 5828**Returns** 5829 5830Returns an 8-bit variable that describes the alpha value. 5831 5832 5833### OH_Drawing_BrushGetColor() 5834 5835``` 5836uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush* ) 5837``` 5838 5839**Description** 5840 5841Obtains the color of a brush. The color is used by the brush to fill in a shape. 5842 5843Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5844 5845If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5846 5847**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5848 5849**Since**: 8 5850 5851**Parameters** 5852 5853| Name| Description| 5854| -------- | -------- | 5855| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5856 5857**Returns** 5858 5859Returns a 32-bit (ARGB) variable that describes the color. 5860 5861 5862### OH_Drawing_BrushGetFilter() 5863 5864``` 5865void OH_Drawing_BrushGetFilter (OH_Drawing_Brush* , OH_Drawing_Filter* ) 5866``` 5867 5868**Description** 5869 5870Obtains the filter of a brush. The filter is a container that holds a mask filter and color filter. 5871 5872Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5873 5874If either **OH_Drawing_Brush** or **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5875 5876**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5877 5878**Since**: 12 5879 5880**Parameters** 5881 5882| Name| Description| 5883| -------- | -------- | 5884| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object.| 5885| OH_Drawing_Filter | Pointer to the [OH_Drawing_Filter](#oh_drawing_filter) object obtained.| 5886 5887 5888### OH_Drawing_BrushIsAntiAlias() 5889 5890``` 5891bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush* ) 5892``` 5893 5894**Description** 5895 5896Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent. 5897 5898Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5899 5900If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5901 5902**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5903 5904**Since**: 8 5905 5906**Parameters** 5907 5908| Name| Description| 5909| -------- | -------- | 5910| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5911 5912**Returns** 5913 5914Returns **true** if anti-aliasing is enabled; returns **false** otherwise. 5915 5916 5917### OH_Drawing_BrushReset() 5918 5919``` 5920void OH_Drawing_BrushReset (OH_Drawing_Brush* ) 5921``` 5922 5923**Description** 5924 5925Resets a brush to the initial state. All configured attributes are cleared. 5926 5927Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5928 5929If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5930 5931**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5932 5933**Since**: 12 5934 5935**Parameters** 5936 5937| Name| Description| 5938| -------- | -------- | 5939| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object.| 5940 5941 5942### OH_Drawing_BrushSetAlpha() 5943 5944``` 5945void OH_Drawing_BrushSetAlpha (OH_Drawing_Brush* , uint8_t alpha ) 5946``` 5947 5948**Description** 5949 5950Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape. 5951 5952Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5953 5954If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5955 5956**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5957 5958**Since**: 11 5959 5960**Parameters** 5961 5962| Name| Description| 5963| -------- | -------- | 5964| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5965| alpha | Alpha value, which is an 8-bit variable.| 5966 5967 5968### OH_Drawing_BrushSetAntiAlias() 5969 5970``` 5971void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush* , bool ) 5972``` 5973 5974**Description** 5975 5976Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent. 5977 5978Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 5979 5980If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 5981 5982**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 5983 5984**Since**: 8 5985 5986**Parameters** 5987 5988| Name| Description| 5989| -------- | -------- | 5990| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 5991| bool | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite.| 5992 5993 5994### OH_Drawing_BrushSetBlendMode() 5995 5996``` 5997void OH_Drawing_BrushSetBlendMode (OH_Drawing_Brush* , OH_Drawing_BlendMode ) 5998``` 5999 6000**Description** 6001 6002Sets a blender for a brush. The blender implements the specified blend mode. 6003 6004Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6005 6006If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6007 6008If **OH_Drawing_BlendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6009 6010**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6011 6012**Since**: 12 6013 6014**Parameters** 6015 6016| Name| Description| 6017| -------- | -------- | 6018| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object.| 6019| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode).| 6020 6021 6022### OH_Drawing_BrushSetColor() 6023 6024``` 6025void OH_Drawing_BrushSetColor (OH_Drawing_Brush* , uint32_t color ) 6026``` 6027 6028**Description** 6029 6030Sets the color for a brush. The color is used by the brush to fill in a shape. 6031 6032Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6033 6034If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6035 6036**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6037 6038**Since**: 8 6039 6040**Parameters** 6041 6042| Name| Description| 6043| -------- | -------- | 6044| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 6045| color | Color, which is a 32-bit (ARGB) variable.| 6046 6047 6048### OH_Drawing_BrushSetFilter() 6049 6050``` 6051void OH_Drawing_BrushSetFilter (OH_Drawing_Brush* , OH_Drawing_Filter* ) 6052``` 6053 6054**Description** 6055 6056Sets a filter for a brush. The filter is a container that holds a mask filter and color filter. 6057 6058Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6059 6060If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6061 6062**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6063 6064**Since**: 11 6065 6066**Parameters** 6067 6068| Name| Description| 6069| -------- | -------- | 6070| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 6071| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. If null is passed in, the filter will be cleared.| 6072 6073 6074### OH_Drawing_BrushSetShaderEffect() 6075 6076``` 6077void OH_Drawing_BrushSetShaderEffect (OH_Drawing_Brush* , OH_Drawing_ShaderEffect* ) 6078``` 6079 6080**Description** 6081 6082Sets the shader effect for a brush. 6083 6084Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6085 6086If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6087 6088**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6089 6090**Since**: 11 6091 6092**Parameters** 6093 6094| Name| Description| 6095| -------- | -------- | 6096| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 6097| OH_Drawing_ShaderEffect | Pointer to an **OH_Drawing_ShaderEffect** object. If NULL is passed in, the shader effect of the brush will be cleared.| 6098 6099 6100### OH_Drawing_CanvasAttachBrush() 6101 6102``` 6103void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas* , const OH_Drawing_Brush* ) 6104``` 6105 6106**Description** 6107 6108Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape. 6109 6110Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6111 6112If either **OH_Drawing_Canvas** or **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6113 6114**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6115 6116**Since**: 8 6117 6118**Parameters** 6119 6120| Name| Description| 6121| -------- | -------- | 6122| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6123| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 6124 6125 6126### OH_Drawing_CanvasAttachPen() 6127 6128``` 6129void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas* , const OH_Drawing_Pen* ) 6130``` 6131 6132**Description** 6133 6134Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. 6135 6136Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6137 6138If either **OH_Drawing_Canvas** or **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6139 6140**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6141 6142**Since**: 8 6143 6144**Parameters** 6145 6146| Name| Description| 6147| -------- | -------- | 6148| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6149| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object.| 6150 6151 6152### OH_Drawing_CanvasBind() 6153 6154``` 6155void OH_Drawing_CanvasBind (OH_Drawing_Canvas* , OH_Drawing_Bitmap* ) 6156``` 6157 6158**Description** 6159 6160Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is called CPU rendering.) A canvas bound to a bitmap is a non-recording canvas. 6161 6162Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6163 6164If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6165 6166**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6167 6168**Since**: 8 6169 6170**Parameters** 6171 6172| Name| Description| 6173| -------- | -------- | 6174| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6175| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 6176 6177 6178### OH_Drawing_CanvasClear() 6179 6180``` 6181void OH_Drawing_CanvasClear (OH_Drawing_Canvas* , uint32_t color ) 6182``` 6183 6184**Description** 6185 6186Clears a canvas by using a given color. 6187 6188Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6189 6190If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6191 6192**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6193 6194**Since**: 8 6195 6196**Parameters** 6197 6198| Name| Description| 6199| -------- | -------- | 6200| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6201| color | Color, which is a 32-bit (ARGB) variable.| 6202 6203 6204### OH_Drawing_CanvasClipPath() 6205 6206``` 6207void OH_Drawing_CanvasClipPath (OH_Drawing_Canvas* , const OH_Drawing_Path* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias ) 6208``` 6209 6210**Description** 6211 6212Clips a path. 6213 6214Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6215 6216If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6217 6218If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6219 6220**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6221 6222**Since**: 11 6223 6224**Parameters** 6225 6226| Name| Description| 6227| -------- | -------- | 6228| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6229| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object.| 6230| clipOp | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop).| 6231| doAntiAlias | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite.| 6232 6233 6234### OH_Drawing_CanvasClipRect() 6235 6236``` 6237void OH_Drawing_CanvasClipRect (OH_Drawing_Canvas* , const OH_Drawing_Rect* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias ) 6238``` 6239 6240**Description** 6241 6242Clips a rectangle. 6243 6244Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6245 6246If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6247 6248If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6249 6250**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6251 6252**Since**: 11 6253 6254**Parameters** 6255 6256| Name| Description| 6257| -------- | -------- | 6258| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6259| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object.| 6260| clipOp | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop).| 6261| doAntiAlias | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite.| 6262 6263### OH_Drawing_CanvasClipRoundRect() 6264 6265``` 6266void OH_Drawing_CanvasClipRoundRect (OH_Drawing_Canvas* , const OH_Drawing_RoundRect* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias ) 6267``` 6268 6269**Description** 6270 6271Clips a rounded rectangle. 6272 6273Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6274 6275If either **OH_Drawing_Canvas** or **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6276 6277If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6278 6279**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6280 6281**Since**: 12 6282 6283**Parameters** 6284 6285| Name| Description| 6286| -------- | -------- | 6287| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6288| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object.| 6289| clipOp | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop).| 6290| doAntiAlias | Whether to perform anti-aliasing. The value **true** means to perform anti-aliasing, and **false** means the opposite.| 6291 6292### OH_Drawing_CanvasConcatMatrix() 6293 6294``` 6295void OH_Drawing_CanvasConcatMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix* ) 6296``` 6297 6298**Description** 6299 6300Preconcats the existing matrix with the passed-in matrix. The drawing operation triggered before this function is called is not affected. 6301 6302Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6303 6304If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6305 6306**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6307 6308**Since**: 12 6309 6310**Parameters** 6311 6312| Name| Description| 6313| -------- | -------- | 6314| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6315| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.| 6316 6317 6318### OH_Drawing_CanvasCreate() 6319 6320``` 6321OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void ) 6322``` 6323 6324**Description** 6325 6326Creates an **OH_Drawing_Canvas** object. 6327 6328**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6329 6330**Since**: 8 6331 6332**Returns** 6333 6334Returns the pointer to the **OH_Drawing_Canvas** object created. 6335 6336 6337### OH_Drawing_CanvasDestroy() 6338 6339``` 6340void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas* ) 6341``` 6342 6343**Description** 6344 6345Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object. 6346 6347**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6348 6349**Since**: 8 6350 6351**Parameters** 6352 6353| Name| Description| 6354| -------- | -------- | 6355| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6356 6357 6358### OH_Drawing_CanvasDetachBrush() 6359 6360``` 6361void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas* ) 6362``` 6363 6364**Description** 6365 6366Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a shape. 6367 6368Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6369 6370If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6371 6372**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6373 6374**Since**: 8 6375 6376**Parameters** 6377 6378| Name| Description| 6379| -------- | -------- | 6380| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6381 6382 6383### OH_Drawing_CanvasDetachPen() 6384 6385``` 6386void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas* ) 6387``` 6388 6389**Description** 6390 6391Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline a shape. 6392 6393Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6394 6395If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6396 6397**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6398 6399**Since**: 8 6400 6401**Parameters** 6402 6403| Name| Description| 6404| -------- | -------- | 6405| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6406 6407 6408### OH_Drawing_CanvasDrawArc() 6409 6410``` 6411void OH_Drawing_CanvasDrawArc (OH_Drawing_Canvas* , const OH_Drawing_Rect* , float startAngle, float sweepAngle ) 6412``` 6413 6414**Description** 6415 6416Draws an arc. 6417 6418Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6419 6420If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6421 6422**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6423 6424**Since**: 11 6425 6426**Parameters** 6427 6428| Name| Description| 6429| -------- | -------- | 6430| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6431| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object.| 6432| startAngle | Start angle of the arc.| 6433| sweepAngle | Sweep angle of the arc.| 6434 6435 6436### OH_Drawing_CanvasDrawBackground() 6437 6438``` 6439void OH_Drawing_CanvasDrawBackground (OH_Drawing_Canvas* , const OH_Drawing_Brush* ) 6440``` 6441 6442**Description** 6443 6444Draws a background filled with a brush. 6445 6446Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6447 6448If either **OH_Drawing_Canvas** or **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6449 6450**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6451 6452**Since**: 12 6453 6454**Parameters** 6455 6456| Name| Description| 6457| -------- | -------- | 6458| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6459| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.| 6460 6461 6462### OH_Drawing_CanvasDrawBitmap() 6463 6464``` 6465void OH_Drawing_CanvasDrawBitmap (OH_Drawing_Canvas* , const OH_Drawing_Bitmap* , float left, float top ) 6466``` 6467 6468**Description** 6469 6470Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, includes single points called pixels (image elements). 6471 6472Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6473 6474If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6475 6476**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6477 6478**Since**: 11 6479 6480**Parameters** 6481 6482| Name| Description| 6483| -------- | -------- | 6484| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6485| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.| 6486| left | X coordinate of the upper left corner of the bitmap.| 6487| top | Y coordinate of the upper left corner of the bitmap.| 6488 6489 6490### OH_Drawing_CanvasDrawBitmapRect() 6491 6492``` 6493void OH_Drawing_CanvasDrawBitmapRect (OH_Drawing_Canvas* , const OH_Drawing_Bitmap* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* ) 6494``` 6495 6496**Description** 6497 6498Draws a portion of a bitmap onto a specified area of the canvas. 6499 6500Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6501 6502If any of **OH_Drawing_Canvas**, **OH_Drawing_Bitmap**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6503 6504**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6505 6506**Since**: 12 6507 6508**Parameters** 6509 6510| Name| Description| 6511| -------- | -------- | 6512| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6513| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.| 6514| src | Pointer to a rectangle on the bitmap. If NULL is passed in, it refers to the entire bitmap.| 6515| dst | Pointer to a rectangle on the canvas.| 6516| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used.| 6517 6518 6519### OH_Drawing_CanvasDrawCircle() 6520 6521``` 6522void OH_Drawing_CanvasDrawCircle (OH_Drawing_Canvas* , const OH_Drawing_Point* , float radius ) 6523``` 6524 6525**Description** 6526 6527Draws a circle. 6528 6529Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6530 6531If either **OH_Drawing_Canvas** or **OH_Drawing_Point** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6532 6533If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6534 6535**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6536 6537**Since**: 11 6538 6539**Parameters** 6540 6541| Name| Description| 6542| -------- | -------- | 6543| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6544| OH_Drawing_Point | Pointer to an **OH_Drawing_Point** object, which indicates the center of the circle.| 6545| radius | Radius of the circle.| 6546 6547 6548### OH_Drawing_CanvasDrawImageRect() 6549 6550``` 6551void OH_Drawing_CanvasDrawImageRect (OH_Drawing_Canvas* , OH_Drawing_Image* , OH_Drawing_Rect* dst, OH_Drawing_SamplingOptions* ) 6552``` 6553 6554**Description** 6555 6556Draws an image onto a specified area of the canvas. 6557 6558Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6559 6560If any of **OH_Drawing_Canvas**, **OH_Drawing_Image**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6561 6562**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6563 6564**Since**: 12 6565 6566**Parameters** 6567 6568| Name| Description| 6569| -------- | -------- | 6570| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6571| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.| 6572| dst | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.| 6573| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used.| 6574 6575 6576### OH_Drawing_CanvasDrawImageRectWithSrc() 6577 6578``` 6579void OH_Drawing_CanvasDrawImageRectWithSrc (OH_Drawing_Canvas* , const OH_Drawing_Image* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* , OH_Drawing_SrcRectConstraint ) 6580``` 6581 6582**Description** 6583 6584Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is scaled and translated to the destination rectangle. 6585 6586Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6587 6588If any of **OH_Drawing_Canvas**, **OH_Drawing_Image**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6589 6590**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6591 6592**Since**: 12 6593 6594**Parameters** 6595 6596| Name| Description| 6597| -------- | -------- | 6598| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6599| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.| 6600| src | Pointer to a source rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object.| 6601| dst | Pointer to a destination rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object.| 6602| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used.| 6603| OH_Drawing_SrcRectConstraint | Constraint type. For details about the available options, see [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint-1).| 6604 6605 6606### OH_Drawing_CanvasDrawLine() 6607 6608``` 6609void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas* , float x1, float y1, float x2, float y2 ) 6610``` 6611 6612**Description** 6613 6614Draws a line segment. 6615 6616Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6617 6618If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6619 6620**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6621 6622**Since**: 8 6623 6624**Parameters** 6625 6626| Name| Description| 6627| -------- | -------- | 6628| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6629| x1 | X coordinate of the start point of the line segment.| 6630| y1 | Y coordinate of the start point of the line segment.| 6631| x2 | X coordinate of the end point of the line segment.| 6632| y2 | Y coordinate of the end point of the line segment.| 6633 6634 6635### OH_Drawing_CanvasDrawOval() 6636 6637``` 6638void OH_Drawing_CanvasDrawOval (OH_Drawing_Canvas* , const OH_Drawing_Rect* ) 6639``` 6640 6641**Description** 6642 6643Draws an oval. 6644 6645Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6646 6647If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6648 6649**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6650 6651**Since**: 11 6652 6653**Parameters** 6654 6655| Name| Description| 6656| -------- | -------- | 6657| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6658| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object.| 6659 6660 6661### OH_Drawing_CanvasDrawPath() 6662 6663``` 6664void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas* , const OH_Drawing_Path* ) 6665``` 6666 6667**Description** 6668 6669Draws a path. 6670 6671Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6672 6673If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6674 6675**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6676 6677**Since**: 8 6678 6679**Parameters** 6680 6681| Name| Description| 6682| -------- | -------- | 6683| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6684| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object.| 6685 6686 6687### OH_Drawing_CanvasDrawPixelMapRect() 6688 6689``` 6690void OH_Drawing_CanvasDrawPixelMapRect (OH_Drawing_Canvas* , OH_Drawing_PixelMap* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* ) 6691``` 6692 6693**Description** 6694 6695Draws a portion of a pixel map onto a specified area of the canvas. 6696 6697Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6698 6699If any of **OH_Drawing_Canvas**, **OH_Drawing_PixelMap**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6700 6701**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6702 6703**Since**: 12 6704 6705**Parameters** 6706 6707| Name| Description| 6708| -------- | -------- | 6709| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6710| OH_Drawing_PixelMap | Pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object.| 6711| src | Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map.| 6712| dst | Pointer to a rectangle on the canvas.| 6713| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used.| 6714 6715 6716### OH_Drawing_CanvasDrawPoints() 6717 6718``` 6719void OH_Drawing_CanvasDrawPoints (OH_Drawing_Canvas* , OH_Drawing_PointMode mode, uint32_t count, const OH_Drawing_Point2D* ) 6720``` 6721 6722**Description** 6723 6724Draws multiple points. You can draw a single point, a line segment, or an open polygon. 6725 6726Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6727 6728If either **OH_Drawing_Canvas** or **OH_Drawing_Point2D** is NULL or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6729 6730If **mode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6731 6732**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6733 6734**Since**: 12 6735 6736**Parameters** 6737 6738| Name| Description| 6739| -------- | -------- | 6740| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6741| mode | Mode of drawing multiple points. For details about the available options, see [OH_Drawing_PointMode](#oh_drawing_pointmode).| 6742| count | Number of vertices, that is, the number of vertices in the vertex array.| 6743| [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Pointer to an array holding the vertices.| 6744 6745 6746### OH_Drawing_CanvasDrawRect() 6747 6748``` 6749void OH_Drawing_CanvasDrawRect (OH_Drawing_Canvas* , const OH_Drawing_Rect* ) 6750``` 6751 6752**Description** 6753 6754Draws a rectangle. 6755 6756Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6757 6758If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6759 6760**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6761 6762**Since**: 11 6763 6764**Parameters** 6765 6766| Name| Description| 6767| -------- | -------- | 6768| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6769| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object.| 6770 6771 6772### OH_Drawing_CanvasDrawRegion() 6773 6774``` 6775void OH_Drawing_CanvasDrawRegion (OH_Drawing_Canvas* , const OH_Drawing_Region* ) 6776``` 6777 6778**Description** 6779 6780Draws a region. 6781 6782Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6783 6784If either **OH_Drawing_Canvas** or **OH_Drawing_Region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6785 6786**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6787 6788**Since**: 12 6789 6790**Parameters** 6791 6792| Name| Description| 6793| -------- | -------- | 6794| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6795| OH_Drawing_Region | Pointer to an **OH_Drawing_Region** object.| 6796 6797 6798### OH_Drawing_CanvasDrawRoundRect() 6799 6800``` 6801void OH_Drawing_CanvasDrawRoundRect (OH_Drawing_Canvas* , const OH_Drawing_RoundRect* ) 6802``` 6803 6804**Description** 6805 6806Draws a rounded rectangle. 6807 6808Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6809 6810If either **OH_Drawing_Canvas** or **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6811 6812**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6813 6814**Since**: 11 6815 6816**Parameters** 6817 6818| Name| Description| 6819| -------- | -------- | 6820| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6821| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object.| 6822 6823 6824### OH_Drawing_CanvasDrawShadow() 6825 6826``` 6827void OH_Drawing_CanvasDrawShadow (OH_Drawing_Canvas* , OH_Drawing_Path* , OH_Drawing_Point3D planeParams, OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, OH_Drawing_CanvasShadowFlags flag ) 6828``` 6829 6830**Description** 6831 6832Draws a spot shadow and uses a given path to outline the ambient shadow. 6833 6834Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6835 6836If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6837 6838If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6839 6840**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6841 6842**Since**: 12 6843 6844**Parameters** 6845 6846| Name| Description| 6847| -------- | -------- | 6848| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6849| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object, which is used to generate the shadow.| 6850| planeParams | Value of the function that returns the Z axis of the occluding object from the canvas based on the X axis and Y axis.| 6851| devLightPos | Position of the light relative to the canvas.| 6852| lightRadius | Radius of the light.| 6853| ambientColor | Color of the ambient shadow.| 6854| spotColor | Color of the spot shadow.| 6855| flag | Shadow flag. For details about the available options, see [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags).| 6856 6857 6858### OH_Drawing_CanvasDrawTextBlob() 6859 6860``` 6861void OH_Drawing_CanvasDrawTextBlob (OH_Drawing_Canvas* , const OH_Drawing_TextBlob* , float x, float y ) 6862``` 6863 6864**Description** 6865 6866Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, that character will not be drawn. 6867 6868Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6869 6870If either **OH_Drawing_Canvas** or **OH_Drawing_TextBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6871 6872**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6873 6874**Since**: 11 6875 6876**Parameters** 6877 6878| Name| Description| 6879| -------- | -------- | 6880| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6881| OH_Drawing_TextBlob | Pointer to an **OH_Drawing_TextBlob** object.| 6882| x | X coordinate of the lower left corner of the text blob.| 6883| y | Y coordinate of the lower left corner of the text blob.| 6884 6885 6886### OH_Drawing_CanvasDrawVertices() 6887 6888``` 6889void OH_Drawing_CanvasDrawVertices (OH_Drawing_Canvas* , OH_Drawing_VertexMode vertexMmode, int32_t vertexCount, const OH_Drawing_Point2D* positions, const OH_Drawing_Point2D* texs, const uint32_t* colors, int32_t indexCount, const uint16_t* indices, OH_Drawing_BlendMode mode ) 6890``` 6891 6892**Description** 6893 6894Draws a triangular grid described by a vertex array. 6895 6896Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6897 6898If either **OH_Drawing_Canvas** or **positions** is NULL, **vertexCount** is less than 3, or **indexCount** is less than 3 but not 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6899 6900If either **vertexMmode** or **mode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 6901 6902**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6903 6904**Since**: 12 6905 6906**Parameters** 6907 6908| Name| Description| 6909| -------- | -------- | 6910| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6911| vertexMmode | Vertex drawing mode. For details about the available options, see [OH_Drawing_VertexMode](#oh_drawing_vertexmode).| 6912| vertexCount | Number of elements in the vertex array. The value must be greater than or equal to 3.| 6913| positions | Pointer to the array that holds the position of every vertex. The array cannot be null and its length must be equal to the value of **vertexCount**.| 6914| texs | Pointer to the array that holds the texture space coordinate corresponding to each vertex. The array can be null. If the array is not null, its length must be equal to the value of **vertexCount**.| 6915| colors | Pointer to the array that holds the color corresponding to each vertex. It is used for interpolation in a triangle. The array can be null. If the array is not null, its length must be equal to the value of **vertexCount**.| 6916| indexCount | Number of indexes. The value can be 0 or a value greater than or equal to 3.| 6917| indices | Pointer to the array that holds the index of each vertex. The array can be null. If the array is not null, its length must be equal to the value of **indexCount**.| 6918| mode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode).| 6919 6920 6921### OH_Drawing_CanvasGetHeight() 6922 6923``` 6924int32_t OH_Drawing_CanvasGetHeight (OH_Drawing_Canvas* ) 6925``` 6926 6927**Description** 6928 6929Obtains the canvas height. 6930 6931Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6932 6933If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6934 6935**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6936 6937**Since**: 12 6938 6939**Parameters** 6940 6941| Name| Description| 6942| -------- | -------- | 6943| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6944 6945**Returns** 6946 6947Returns the canvas height, in pixels. 6948 6949 6950### OH_Drawing_CanvasGetLocalClipBounds() 6951 6952``` 6953void OH_Drawing_CanvasGetLocalClipBounds (OH_Drawing_Canvas* , OH_Drawing_Rect* ) 6954``` 6955 6956**Description** 6957 6958Obtains the bounds of the cropping region of a canvas. This function cannot be used for recorded canvases. 6959 6960Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6961 6962If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6963 6964**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6965 6966**Since**: 12 6967 6968**Parameters** 6969 6970| Name| Description| 6971| -------- | -------- | 6972| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 6973| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is obtained by calling [OH_Drawing_RectCreate](#oh_drawing_rectcreate).| 6974 6975 6976### OH_Drawing_CanvasGetSaveCount() 6977 6978``` 6979uint32_t OH_Drawing_CanvasGetSaveCount (OH_Drawing_Canvas* ) 6980``` 6981 6982**Description** 6983 6984Obtains the number of canvas statuses (canvas matrices) saved in the stack. 6985 6986Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 6987 6988If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 6989 6990**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 6991 6992**Since**: 11 6993 6994**Parameters** 6995 6996| Name| Description| 6997| -------- | -------- | 6998| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.| 6999 7000**Returns** 7001 7002Returns a 32-bit value that describes the number of canvas statuses (canvas matrices). The initial number is **1**. 7003 7004 7005### OH_Drawing_CanvasGetTotalMatrix() 7006 7007``` 7008void OH_Drawing_CanvasGetTotalMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix* ) 7009``` 7010 7011**Description** 7012 7013Obtains the 3x3 matrix of a canvas. 7014 7015Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7016 7017If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7018 7019**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7020 7021**Since**: 12 7022 7023**Parameters** 7024 7025| Name| Description| 7026| -------- | -------- | 7027| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 7028| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object, which is obtained by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate).| 7029 7030 7031### OH_Drawing_CanvasGetWidth() 7032 7033``` 7034int32_t OH_Drawing_CanvasGetWidth (OH_Drawing_Canvas* ) 7035``` 7036 7037**Description** 7038 7039Obtains the canvas width. 7040 7041Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7042 7043If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7044 7045**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7046 7047**Since**: 12 7048 7049**Parameters** 7050 7051| Name| Description| 7052| -------- | -------- | 7053| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 7054 7055**Returns** 7056 7057Returns the canvas width, in px. 7058 7059 7060### OH_Drawing_CanvasReadPixels() 7061 7062``` 7063bool OH_Drawing_CanvasReadPixels (OH_Drawing_Canvas* , OH_Drawing_Image_Info* , void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY ) 7064``` 7065 7066**Description** 7067 7068Copies pixel data from a canvas to a specified address. This function cannot be used for recorded canvases. 7069 7070Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7071 7072If any of **OH_Drawing_Canvas**, **OH_Drawing_Image_Info**, and **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7073 7074**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7075 7076**Since**: 12 7077 7078**Parameters** 7079 7080| Name| Description| 7081| -------- | -------- | 7082| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 7083| [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.| 7084| dstPixels | Pointer to the start address for storing the pixel data.| 7085| dstRowBytes | Size of pixels per row.| 7086| srcX | X offset of the pixels on the canvas, in px.| 7087| srcY | Y offset of the pixels on the canvas, in px.| 7088 7089**Returns** 7090 7091Returns **true** if the pixel data is copied to the start address of the storage; returns **false** otherwise. 7092 7093 7094### OH_Drawing_CanvasReadPixelsToBitmap() 7095 7096``` 7097bool OH_Drawing_CanvasReadPixelsToBitmap (OH_Drawing_Canvas* , OH_Drawing_Bitmap* , int32_t srcX, int32_t srcY ) 7098``` 7099 7100**Description** 7101 7102Copies pixel data from a canvas to an image. This function cannot be used for recorded canvases. 7103 7104Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7105 7106If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7107 7108**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7109 7110**Since**: 12 7111 7112**Parameters** 7113 7114| Name| Description| 7115| -------- | -------- | 7116| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 7117| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.| 7118| srcX | X offset of the pixels on the canvas, in px.| 7119| srcY | Y offset of the pixels on the canvas, in px.| 7120 7121**Returns** 7122 7123Returns **true** if the pixel data is copied to the image; returns **false** otherwise. 7124 7125 7126### OH_Drawing_CanvasResetMatrix() 7127 7128``` 7129void OH_Drawing_CanvasResetMatrix (OH_Drawing_Canvas* ) 7130``` 7131 7132**Description** 7133 7134Resets the matrix of a canvas to an identity matrix. 7135 7136Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7137 7138If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7139 7140**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7141 7142**Since**: 12 7143 7144**Parameters** 7145 7146| Name| Description| 7147| -------- | -------- | 7148| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.| 7149 7150 7151### OH_Drawing_CanvasRestore() 7152 7153``` 7154void OH_Drawing_CanvasRestore (OH_Drawing_Canvas* ) 7155``` 7156 7157**Description** 7158 7159Restores the canvas status (canvas matrix) saved on the top of the stack. 7160 7161Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7162 7163If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7164 7165**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7166 7167**Since**: 8 7168 7169**Parameters** 7170 7171| Name | Description | 7172| ----------------- | ------------------------------------------- | 7173| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7174 7175 7176### OH_Drawing_CanvasRestoreToCount() 7177 7178``` 7179void OH_Drawing_CanvasRestoreToCount (OH_Drawing_Canvas* , uint32_t saveCount ) 7180``` 7181 7182**Description** 7183 7184Restores to a given number of canvas statuses (canvas matrices). 7185 7186Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7187 7188If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7189 7190**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7191 7192**Since**: 11 7193 7194**Parameters** 7195 7196| Name | Description | 7197| ----------------- | ------------------------------------------------------------ | 7198| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7199| saveCount | Number of canvas statuses (canvas matrices). If the value is less than or equal to 1, the canvas is restored to the initial state. If the value is greater than the number of canvas statuses that have been saved, no operation is performed. | 7200 7201 7202### OH_Drawing_CanvasRotate() 7203 7204``` 7205void OH_Drawing_CanvasRotate (OH_Drawing_Canvas* , float degrees, float px, float py ) 7206``` 7207 7208**Description** 7209 7210Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation. 7211 7212Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7213 7214If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7215 7216**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7217 7218**Since**: 11 7219 7220**Parameters** 7221 7222| Name | Description | 7223| ----------------- | ------------------------------------------- | 7224| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7225| degrees | Angle to rotate. | 7226| px | X coordinate of the rotation point. | 7227| py | Y coordinate of the rotation point. | 7228 7229 7230### OH_Drawing_CanvasSave() 7231 7232``` 7233void OH_Drawing_CanvasSave (OH_Drawing_Canvas* ) 7234``` 7235 7236**Description** 7237 7238Saves the current canvas status (canvas matrix) to the top of the stack. 7239 7240Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7241 7242If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7243 7244**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7245 7246**Since**: 8 7247 7248**Parameters** 7249 7250| Name | Description | 7251| ----------------- | ------------------------------------------- | 7252| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7253 7254 7255### OH_Drawing_CanvasSaveLayer() 7256 7257``` 7258void OH_Drawing_CanvasSaveLayer (OH_Drawing_Canvas* , const OH_Drawing_Rect* , const OH_Drawing_Brush* ) 7259``` 7260 7261**Description** 7262 7263Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore), the changes made to the matrix and clipping region are discarded, and the bitmap is drawn. 7264 7265Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7266 7267If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7268 7269**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7270 7271**Since**: 12 7272 7273**Parameters** 7274 7275| Name | Description | 7276| ----------------- | ------------------------------------------------------------ | 7277| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. | 7278| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is used to limit the size of the graphics layer. If NULL is passed in, the size is not limited. | 7279| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object. The alpha value, filter effect, and blend mode of the brush are applied when the bitmap is drawn. If NULL is passed in, no effect is applied. | 7280 7281 7282### OH_Drawing_CanvasScale() 7283 7284``` 7285void OH_Drawing_CanvasScale (OH_Drawing_Canvas* , float sx, float sy ) 7286``` 7287 7288**Description** 7289 7290Scales a canvas. 7291 7292Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7293 7294If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7295 7296**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7297 7298**Since**: 11 7299 7300**Parameters** 7301 7302| Name | Description | 7303| ----------------- | ------------------------------------------- | 7304| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7305| sx | Scale ratio on the X axis. | 7306| sy | Scale ratio on the Y axis. | 7307 7308 7309### OH_Drawing_CanvasSetMatrix() 7310 7311``` 7312void OH_Drawing_CanvasSetMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix* ) 7313``` 7314 7315**Description** 7316 7317Sets the matrix status for a canvas. 7318 7319Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7320 7321If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7322 7323**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7324 7325**Since**: 12 7326 7327**Parameters** 7328 7329| Name | Description | 7330| ----------------- | ------------------------------------------------------------ | 7331| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. | 7332| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object, which is obtained by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate). | 7333 7334 7335### OH_Drawing_CanvasSkew() 7336 7337``` 7338void OH_Drawing_CanvasSkew (OH_Drawing_Canvas* , float sx, float sy ) 7339``` 7340 7341**Description** 7342 7343Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and applies the resulting matrix to the canvas. The skew transformation matrix is as follows: \|1 sx 0\| \|sy 1 0\| \|0 0 1\| 7344 7345Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7346 7347If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7348 7349**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7350 7351**Since**: 12 7352 7353**Parameters** 7354 7355| Name | Description | 7356| ----------------- | ------------------------------------------------------------ | 7357| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7358| sx | Amount of tilt on the X axis. A positive number tilts the drawing rightwards along the positive direction of the Y axis, and a negative number tilts the drawing leftwards along the positive direction of the Y axis. | 7359| sy | Amount of tilt on the Y axis. A positive number tilts the drawing downwards along the positive direction of the X axis, and a negative number tilts the drawing upwards along the positive direction of the X axis. | 7360 7361 7362### OH_Drawing_CanvasTranslate() 7363 7364``` 7365void OH_Drawing_CanvasTranslate (OH_Drawing_Canvas* , float dx, float dy ) 7366``` 7367 7368**Description** 7369 7370Translates a canvas by a given distance. 7371 7372Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7373 7374If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7375 7376**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7377 7378**Since**: 11 7379 7380**Parameters** 7381 7382| Name | Description | 7383| ----------------- | ------------------------------------------- | 7384| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. | 7385| dx | Distance to translate on the X axis. | 7386| dy | Distance to translate on the Y axis. | 7387 7388 7389### OH_Drawing_ColorFilterCreateBlendMode() 7390 7391``` 7392OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateBlendMode (uint32_t color, OH_Drawing_BlendMode ) 7393``` 7394 7395**Description** 7396 7397Creates an **OH_Drawing_ColorFilter** object with a given blend mode. 7398 7399**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7400 7401**Since**: 11 7402 7403**Parameters** 7404 7405| Name | Description | 7406| -------------------- | ------------------------------------------------------------ | 7407| color | Color, which is a 32-bit (ARGB) variable. | 7408| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). | 7409 7410**Returns** 7411 7412Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7413 7414 7415### OH_Drawing_ColorFilterCreateCompose() 7416 7417``` 7418OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateCompose (OH_Drawing_ColorFilter* colorFilter1, OH_Drawing_ColorFilter* colorFilter2 ) 7419``` 7420 7421**Description** 7422 7423Creates an **OH_Drawing_ColorFilter** object by combining another two color filters. 7424 7425Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7426 7427If either **colorFilter1** or **colorFilter2** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7428 7429**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7430 7431**Since**: 11 7432 7433**Parameters** 7434 7435| Name | Description | 7436| ------------ | ----------------------------------- | 7437| colorFilter1 | Pointer to the first color filter. | 7438| colorFilter2 | Pointer to the second color filter. | 7439 7440**Returns** 7441 7442Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7443 7444 7445### OH_Drawing_ColorFilterCreateLinearToSrgbGamma() 7446 7447``` 7448OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLinearToSrgbGamma (void ) 7449``` 7450 7451**Description** 7452 7453Creates an **OH_Drawing_ColorFilter** object that applies the sRGB gamma curve to the RGB channels. 7454 7455**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7456 7457**Since**: 11 7458 7459**Returns** 7460 7461Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7462 7463 7464### OH_Drawing_ColorFilterCreateLuma() 7465 7466``` 7467OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLuma (void ) 7468``` 7469 7470**Description** 7471 7472Creates an **OH_Drawing_ColorFilter** object that multiplies the passed-in luma into the alpha channel and sets the RGB channels to zero. 7473 7474**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7475 7476**Since**: 11 7477 7478**Returns** 7479 7480Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7481 7482 7483### OH_Drawing_ColorFilterCreateMatrix() 7484 7485``` 7486OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateMatrix (const float matrix[20]) 7487``` 7488 7489**Description** 7490 7491Creates an **OH_Drawing_ColorFilter** object with a given 5x4 color matrix. 7492 7493Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7494 7495If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7496 7497**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7498 7499**Since**: 11 7500 7501**Parameters** 7502 7503| Name | Description | 7504| ------ | ------------------------------------------------------------ | 7505| matrix | Matrix, which is represented by a floating-point array with a length of 20. | 7506 7507**Returns** 7508 7509Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7510 7511 7512### OH_Drawing_ColorFilterCreateSrgbGammaToLinear() 7513 7514``` 7515OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateSrgbGammaToLinear (void ) 7516``` 7517 7518**Description** 7519 7520Creates an **OH_Drawing_ColorFilter** object that applies the RGB channels to the sRGB gamma curve. 7521 7522**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7523 7524**Since**: 11 7525 7526**Returns** 7527 7528Returns the pointer to the **OH_Drawing_ColorFilter** object created. 7529 7530 7531### OH_Drawing_ColorFilterDestroy() 7532 7533``` 7534void OH_Drawing_ColorFilterDestroy (OH_Drawing_ColorFilter* ) 7535``` 7536 7537**Description** 7538 7539Destroys an **OH_Drawing_ColorFilter** object and reclaims the memory occupied by the object. 7540 7541**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7542 7543**Since**: 11 7544 7545**Parameters** 7546 7547| Name | Description | 7548| ---------------------- | ------------------------------------------------ | 7549| OH_Drawing_ColorFilter | Pointer to an **OH_Drawing_ColorFilter** object. | 7550 7551 7552### OH_Drawing_ColorSetArgb() 7553 7554``` 7555uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue ) 7556``` 7557 7558**Description** 7559 7560Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color. 7561 7562**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7563 7564**Since**: 8 7565 7566**Parameters** 7567 7568| Name | Description | 7569| ----- | ----------------------------------------------------- | 7570| alpha | Alpha, which is a variable ranging from 0x00 to 0xFF. | 7571| red | Read, which is a variable ranging from 0x00 to 0xFF. | 7572| green | Green, which is a variable ranging from 0x00 to 0xFF. | 7573| blue | Blue, which is a variable ranging from 0x00 to 0xFF. | 7574 7575**Returns** 7576 7577Returns a 32-bit (ARGB) variable that describes the color. 7578 7579 7580### OH_Drawing_ColorSpaceCreateSrgb() 7581 7582``` 7583OH_Drawing_ColorSpace* OH_Drawing_ColorSpaceCreateSrgb (void ) 7584``` 7585 7586**Description** 7587 7588Creates an sRGB color space. 7589 7590**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7591 7592**Since**: 12 7593 7594**Returns** 7595 7596Returns the pointer to the [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object created. 7597 7598 7599### OH_Drawing_ColorSpaceCreateSrgbLinear() 7600 7601``` 7602OH_Drawing_ColorSpace* OH_Drawing_ColorSpaceCreateSrgbLinear (void ) 7603``` 7604 7605**Description** 7606 7607Creates an sRGB linear (Gamma 1.0) color space. 7608 7609**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7610 7611**Since**: 12 7612 7613**Returns** 7614 7615Returns the pointer to the [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object created. 7616 7617 7618### OH_Drawing_ColorSpaceDestroy() 7619 7620``` 7621void OH_Drawing_ColorSpaceDestroy (OH_Drawing_ColorSpace* ) 7622``` 7623 7624**Description** 7625 7626Destroys an **OH_Drawing_ColorSpace** object and reclaims the memory occupied by the object. 7627 7628**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7629 7630**Since**: 12 7631 7632**Parameters** 7633 7634| Name | Description | 7635| --------------------- | ------------------------------------------------------------ | 7636| OH_Drawing_ColorSpace | Pointer to an [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object. | 7637 7638 7639### OH_Drawing_CreateDashPathEffect() 7640 7641``` 7642OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect (float* intervals, int count, float phase ) 7643``` 7644 7645**Description** 7646 7647Creates an **OH_Drawing_PathEffect** object with a dashed line effect. The dashed line effect is determined by a group of "on" and "off" intervals. 7648 7649Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 7650 7651If **intervals** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 7652 7653**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7654 7655**Since**: 12 7656 7657**Parameters** 7658 7659| Name | Description | 7660| --------- | ------------------------------------------------------------ | 7661| intervals | Pointer to the start address of the dashed line interval array. In the array, an even entry indicates an "on" interval and an odd entry indicates an "off" interval. The unit is px. | 7662| count | Number of entries in the dashed line interval array. The value must be an even number greater than 0. | 7663| phase | Offset in the dashed line interval array. | 7664 7665**Returns** 7666 7667Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created. 7668 7669 7670### OH_Drawing_CreateFontCollection() 7671 7672``` 7673OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void ) 7674``` 7675 7676**Description** 7677 7678Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. The [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object created by this function can be used by only one [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. To share an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object among multiple [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) objects, use [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) to create it. 7679 7680**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7681 7682**Since**: 8 7683 7684**Returns** 7685 7686Returns the pointer to the **OH_Drawing_FontCollection** object created. 7687 7688 7689### OH_Drawing_CreateFontDescriptor() 7690 7691``` 7692OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor (void ) 7693``` 7694 7695**Description** 7696 7697Creates an **OH_Drawing_FontDescriptor** object to describe the detailed information about a system font. 7698 7699**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7700 7701**Since**: 12 7702 7703**Returns** 7704 7705Returns the pointer to the [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object created. 7706 7707 7708### OH_Drawing_CreateFontParser() 7709 7710``` 7711OH_Drawing_FontParser* OH_Drawing_CreateFontParser (void ) 7712``` 7713 7714**Description** 7715 7716Creates an **OH_Drawing_FontParser** object to parse a system font. 7717 7718**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7719 7720**Since**: 12 7721 7722**Returns** 7723 7724Returns the pointer to the [OH_Drawing_FontParser](#oh_drawing_fontparser) object created. 7725 7726 7727### OH_Drawing_CreateSharedFontCollection() 7728 7729``` 7730OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection (void ) 7731``` 7732 7733**Description** 7734 7735Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object that is shareable. 7736 7737**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7738 7739**Since**: 12 7740 7741**Returns** 7742 7743Returns the pointer to the **OH_Drawing_FontCollection** object created. 7744 7745### OH_Drawing_ClearFontCaches() 7746 7747``` 7748void OH_Drawing_ClearFontCaches (OH_Drawing_FontCollection* ) 7749``` 7750 7751**Description** 7752 7753Clears the font cache. (The font cache has a memory limit and a clearing mechanism. It occupies limited memory. You are not advised to clear it unless otherwise required.) 7754 7755**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7756 7757**Since**: 12 7758 7759**Parameters** 7760 7761| Name | Description | 7762| ------------------------- | ------------------------------------------------------------ | 7763| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. | 7764 7765### OH_Drawing_CreateTextShadow() 7766 7767``` 7768OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow (void ) 7769``` 7770 7771**Description** 7772 7773Creates an **OH_Drawing_TextShadow** object. 7774 7775**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7776 7777**Since**: 12 7778 7779**Returns** 7780 7781Returns the pointer to the **OH_Drawing_TextShadow** object created. 7782 7783 7784### OH_Drawing_CreateTextStyle() 7785 7786``` 7787OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void ) 7788``` 7789 7790**Description** 7791 7792Creates an **OH_Drawing_TextStyle** object. 7793 7794**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7795 7796**Since**: 8 7797 7798**Returns** 7799 7800Returns the pointer to the **OH_Drawing_TextStyle** object created. 7801 7802 7803### OH_Drawing_CreateTypography() 7804 7805``` 7806OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate* ) 7807``` 7808 7809**Description** 7810 7811Creates an **OH_Drawing_Typography** object. 7812 7813**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7814 7815**Since**: 8 7816 7817**Parameters** 7818 7819| Name | Description | 7820| --------------------------- | ------------------------------------------------------------ | 7821| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 7822 7823**Returns** 7824 7825Returns the pointer to the **OH_Drawing_Typography** object created. 7826 7827 7828### OH_Drawing_CreateTypographyHandler() 7829 7830``` 7831OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_TypographyStyle* , OH_Drawing_FontCollection* ) 7832``` 7833 7834**Description** 7835 7836Creates an **OH_Drawing_TypographyCreate** object. 7837 7838**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7839 7840**Since**: 8 7841 7842**Parameters** 7843 7844| Name | Description | 7845| -------------------------- | ------------------------------------------------------------ | 7846| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 7847| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object, which is obtained by calling [OH_Drawing_CreateFontCollection](#oh_drawing_createfontcollection) or [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) (recommended). | 7848 7849**Returns** 7850 7851Returns the pointer to the **OH_Drawing_TypographyCreate** object created. 7852 7853 7854### OH_Drawing_CreateTypographyStyle() 7855 7856``` 7857OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void ) 7858``` 7859 7860**Description** 7861 7862Creates an **OH_Drawing_TypographyStyle** object. 7863 7864**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7865 7866**Since**: 8 7867 7868**Returns** 7869 7870Returns the pointer to the **OH_Drawing_TypographyStyle** object created. 7871 7872 7873### OH_Drawing_DestroyFontCollection() 7874 7875``` 7876void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection* ) 7877``` 7878 7879**Description** 7880 7881Destroys an **OH_Drawing_FontCollection** object and reclaims the memory occupied by the object. 7882 7883**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7884 7885**Since**: 8 7886 7887**Parameters** 7888 7889| Name | Description | 7890| ------------------------- | --------------------------------------------------- | 7891| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. | 7892 7893 7894### OH_Drawing_DestroyFontDescriptor() 7895 7896``` 7897void OH_Drawing_DestroyFontDescriptor (OH_Drawing_FontDescriptor* ) 7898``` 7899 7900**Description** 7901 7902Destroys an **OH_Drawing_FontDescriptor** object and reclaims the memory occupied by the object. 7903 7904**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7905 7906**Since**: 12 7907 7908**Parameters** 7909 7910| Name | Description | 7911| ------------------------------------------------------------ | ------------------------------------------------------------ | 7912| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Pointer to an [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object, which is obtained by calling [OH_Drawing_CreateFontDescriptor](#oh_drawing_createfontdescriptor). | 7913 7914 7915### OH_Drawing_DestroyFontParser() 7916 7917``` 7918void OH_Drawing_DestroyFontParser (OH_Drawing_FontParser* ) 7919``` 7920 7921**Description** 7922 7923Destroys an **OH_Drawing_FontParser** object and reclaims the memory occupied by the object. 7924 7925**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7926 7927**Since**: 12 7928 7929**Parameters** 7930 7931| Name | Description | 7932| --------------------- | ------------------------------------------------------------ | 7933| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). | 7934 7935 7936### OH_Drawing_DestroyLineMetrics() 7937 7938``` 7939void OH_Drawing_DestroyLineMetrics (OH_Drawing_LineMetrics* ) 7940``` 7941 7942**Description** 7943 7944Destroys an **OH_Drawing_LineMetrics** object and reclaims the memory occupied by the object. 7945 7946**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7947 7948**Since**: 12 7949 7950**Parameters** 7951 7952| Name | Description | 7953| ---------------------- | ------------------------------------------------------------ | 7954| OH_Drawing_LineMetrics | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). | 7955 7956 7957### OH_Drawing_DestroySystemFontConfigInfo() 7958 7959``` 7960void OH_Drawing_DestroySystemFontConfigInfo (OH_Drawing_FontConfigInfo* ) 7961``` 7962 7963**Description** 7964 7965Reclaims the memory occupied by the system font configuration. 7966 7967**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7968 7969**Since**: 12 7970 7971**Parameters** 7972 7973| Name | Description | 7974| ------------------------- | ------------------------------------------------------------ | 7975| OH_Drawing_FontConfigInfo | Pointer to an [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) object, which is obtained by calling [OH_Drawing_GetSystemFontConfigInfo](#oh_drawing_getsystemfontconfiginfo). | 7976 7977 7978### OH_Drawing_DestroySystemFontList() 7979 7980``` 7981void OH_Drawing_DestroySystemFontList (char** , size_t ) 7982``` 7983 7984**Description** 7985 7986Reclaims the memory occupied by the system font list. 7987 7988**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 7989 7990**Since**: 12 7991 7992**Parameters** 7993 7994| Name | Description | 7995| -------- | ------------------------------------------------ | 7996| char\*\* | Double pointer to the list of system font names. | 7997| size_t\* | Number of system font names. | 7998 7999 8000### OH_Drawing_DestroyTextShadow() 8001 8002``` 8003void OH_Drawing_DestroyTextShadow (OH_Drawing_TextShadow* ) 8004``` 8005 8006**Description** 8007 8008Destroys an **OH_Drawing_TextShadow** object and reclaims the memory occupied by the object. 8009 8010**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8011 8012**Since**: 12 8013 8014**Parameters** 8015 8016| Name | Description | 8017| --------------------- | ------------------------------------------------------------ | 8018| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). | 8019 8020 8021### OH_Drawing_DestroyTextShadows() 8022 8023``` 8024void OH_Drawing_DestroyTextShadows (OH_Drawing_TextShadow* ) 8025``` 8026 8027**Description** 8028 8029Reclaims the memory occupied by the vector consisting of the **OH_Drawing_TextShadow** objects. 8030 8031**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8032 8033**Since**: 12 8034 8035**Parameters** 8036 8037| Name | Description | 8038| --------------------- | ------------------------------------------------------------ | 8039| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). | 8040 8041 8042### OH_Drawing_DestroyTextStyle() 8043 8044``` 8045void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle* ) 8046``` 8047 8048**Description** 8049 8050Destroys an **OH_Drawing_TextStyle** object and reclaims the memory occupied by the object. 8051 8052**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8053 8054**Since**: 8 8055 8056**Parameters** 8057 8058| Name | Description | 8059| -------------------- | ------------------------------------------------------------ | 8060| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 8061 8062 8063### OH_Drawing_DestroyTypography() 8064 8065``` 8066void OH_Drawing_DestroyTypography (OH_Drawing_Typography* ) 8067``` 8068 8069**Description** 8070 8071Destroys an **OH_Drawing_Typography** object and reclaims the memory occupied by the object. 8072 8073**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8074 8075**Since**: 8 8076 8077**Parameters** 8078 8079| Name | Description | 8080| --------------------- | ------------------------------------------------------------ | 8081| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 8082 8083 8084### OH_Drawing_DestroyTypographyHandler() 8085 8086``` 8087void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate* ) 8088``` 8089 8090**Description** 8091 8092Destroys an **OH_Drawing_TypographyCreate** object and reclaims the memory occupied by the object. 8093 8094**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8095 8096**Since**: 8 8097 8098**Parameters** 8099 8100| Name | Description | 8101| --------------------------- | ------------------------------------------------------------ | 8102| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 8103 8104 8105### OH_Drawing_DestroyTypographyStyle() 8106 8107``` 8108void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle* ) 8109``` 8110 8111**Description** 8112 8113Destroys an **OH_Drawing_TypographyStyle** object and reclaims the memory occupied by the object. 8114 8115**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8116 8117**Since**: 8 8118 8119**Parameters** 8120 8121| Name | Description | 8122| -------------------------- | ------------------------------------------------------------ | 8123| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 8124 8125 8126### OH_Drawing_DisableFontCollectionFallback() 8127 8128``` 8129void OH_Drawing_DisableFontCollectionFallback (OH_Drawing_FontCollection* fontCollection) 8130``` 8131 8132**Description** 8133 8134Disables the alternate fonts. 8135 8136**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8137 8138**Since**: 12 8139 8140**Parameters** 8141 8142| Name | Description | 8143| ------------------------- | ------------------------------------------------------------ | 8144| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. | 8145 8146 8147### OH_Drawing_DisableFontCollectionSystemFont() 8148 8149``` 8150void OH_Drawing_DisableFontCollectionSystemFont (OH_Drawing_FontCollection* fontCollection) 8151``` 8152 8153**Description** 8154 8155Disables the system fonts. 8156 8157**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8158 8159**Since**: 12 8160 8161**Parameters** 8162 8163| Name | Description | 8164| ------------------------- | ------------------------------------------------------------ | 8165| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. | 8166 8167 8168### OH_Drawing_FilterCreate() 8169 8170``` 8171OH_Drawing_Filter* OH_Drawing_FilterCreate (void ) 8172``` 8173 8174**Description** 8175 8176Creates an **OH_Drawing_Filter** object. 8177 8178**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8179 8180**Since**: 11 8181 8182**Returns** 8183 8184Returns the pointer to the **OH_Drawing_Filter** object created. 8185 8186 8187### OH_Drawing_FilterDestroy() 8188 8189``` 8190void OH_Drawing_FilterDestroy (OH_Drawing_Filter* ) 8191``` 8192 8193**Description** 8194 8195Destroys an **OH_Drawing_Filter** object and reclaims the memory occupied by the object. 8196 8197**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8198 8199**Since**: 11 8200 8201**Parameters** 8202 8203| Name | Description | 8204| ----------------- | ------------------------------------------- | 8205| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. | 8206 8207 8208### OH_Drawing_FilterGetColorFilter() 8209 8210``` 8211void OH_Drawing_FilterGetColorFilter (OH_Drawing_Filter* , OH_Drawing_ColorFilter* ) 8212``` 8213 8214**Description** 8215 8216Obtains an **OH_Drawing_ColorFilter** object from an **OH_Drawing_Filter** object. 8217 8218Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8219 8220If either **OH_Drawing_Filter** or **OH_Drawing_ColorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8221 8222**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8223 8224**Since**: 12 8225 8226**Parameters** 8227 8228| Name | Description | 8229| ---------------------- | ------------------------------------------------------------ | 8230| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. | 8231| OH_Drawing_ColorFilter | Pointer to an [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) object. | 8232 8233 8234### OH_Drawing_FilterSetColorFilter() 8235 8236``` 8237void OH_Drawing_FilterSetColorFilter (OH_Drawing_Filter* , OH_Drawing_ColorFilter* ) 8238``` 8239 8240**Description** 8241 8242Sets an **OH_Drawing_ColorFilter** object for an **OH_Drawing_Filter** object. 8243 8244Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8245 8246If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8247 8248**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8249 8250**Since**: 11 8251 8252**Parameters** 8253 8254| Name | Description | 8255| ---------------------- | ------------------------------------------------------------ | 8256| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. | 8257| OH_Drawing_ColorFilter | Pointer to an **OH_Drawing_ColorFilter** object. If NULL is passed in, the color filter effect of the object will be cleared. | 8258 8259 8260### OH_Drawing_FilterSetMaskFilter() 8261 8262``` 8263void OH_Drawing_FilterSetMaskFilter (OH_Drawing_Filter* , OH_Drawing_MaskFilter* ) 8264``` 8265 8266**Description** 8267 8268Sets an **OH_Drawing_MaskFilter** object for an **OH_Drawing_Filter** object. 8269 8270Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8271 8272If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8273 8274**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8275 8276**Since**: 11 8277 8278**Parameters** 8279 8280| Name | Description | 8281| --------------------- | ------------------------------------------------------------ | 8282| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. | 8283| OH_Drawing_MaskFilter | Pointer to an **OH_Drawing_MaskFilter** object. If NULL is passed in, the mask filter effect of the object will be cleared. | 8284 8285 8286### OH_Drawing_FontCountText() 8287 8288``` 8289int OH_Drawing_FontCountText (OH_Drawing_Font* , const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding ) 8290``` 8291 8292**Description** 8293 8294Obtains the number of glyphs represented by text. 8295 8296Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8297 8298If either **OH_Drawing_Font** or **text** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8299 8300**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8301 8302**Since**: 12 8303 8304**Parameters** 8305 8306| Name | Description | 8307| --------------- | ------------------------------------------------------------ | 8308| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 8309| text | Pointer to the start address of the storage. | 8310| byteLength | Text length, in bytes. | 8311| encoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). | 8312 8313 8314### OH_Drawing_FontCreate() 8315 8316``` 8317OH_Drawing_Font* OH_Drawing_FontCreate (void ) 8318``` 8319 8320**Description** 8321 8322Creates an **OH_Drawing_Font** object. 8323 8324**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8325 8326**Since**: 11 8327 8328**Returns** 8329 8330Returns the pointer to the **OH_Drawing_Font** object created. 8331 8332 8333### OH_Drawing_FontDestroy() 8334 8335``` 8336void OH_Drawing_FontDestroy (OH_Drawing_Font* ) 8337``` 8338 8339**Description** 8340 8341Destroys an **OH_Drawing_Font** object and reclaims the memory occupied by the object. 8342 8343**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8344 8345**Since**: 11 8346 8347**Parameters** 8348 8349| Name | Description | 8350| --------------- | ----------------------------------------- | 8351| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8352 8353 8354### OH_Drawing_FontGetMetrics() 8355 8356``` 8357float OH_Drawing_FontGetMetrics (OH_Drawing_Font* , OH_Drawing_Font_Metrics* ) 8358``` 8359 8360**Description** 8361 8362Obtains the measurement information about a font. 8363 8364Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8365 8366If either **OH_Drawing_Font** or **OH_Drawing_Font_Metrics** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8367 8368**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8369 8370**Since**: 12 8371 8372**Parameters** 8373 8374| Name | Description | 8375| ----------------------- | ------------------------------------------------------------ | 8376| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 8377| OH_Drawing_Font_Metrics | Pointer to an [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) object. | 8378 8379**Returns** 8380 8381Returns a floating-point variable that indicates the recommended interline spacing. 8382 8383 8384### OH_Drawing_FontGetTypeface() 8385 8386``` 8387OH_Drawing_Typeface* OH_Drawing_FontGetTypeface (OH_Drawing_Font* ) 8388``` 8389 8390**Description** 8391 8392Obtains the typeface of a font. 8393 8394Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8395 8396If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8397 8398**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8399 8400**Since**: 12 8401 8402**Parameters** 8403 8404| Name | Description | 8405| --------------- | --------------------------------------------------------- | 8406| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 8407 8408**Returns** 8409 8410Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object. 8411 8412 8413### OH_Drawing_FontMgrCreate() 8414 8415``` 8416OH_Drawing_FontMgr* OH_Drawing_FontMgrCreate (void ) 8417``` 8418 8419**Description** 8420 8421Creates an **OH_Drawing_FontMgr** object. 8422 8423**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8424 8425**Since**: 12 8426 8427**Returns** 8428 8429Returns the pointer to the [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object created. 8430 8431 8432### OH_Drawing_FontMgrCreateFontStyleSet() 8433 8434``` 8435OH_Drawing_FontStyleSet* OH_Drawing_FontMgrCreateFontStyleSet (OH_Drawing_FontMgr* , int index ) 8436``` 8437 8438**Description** 8439 8440Creates a font style set from an **OH_Drawing_FontMgr** object. 8441 8442**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8443 8444**Since**: 12 8445 8446**Parameters** 8447 8448| Name | Description | 8449| ------------------ | ------------------------------------------------------------ | 8450| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8451| index | Index of the font style set. | 8452 8453**Returns** 8454 8455Returns the pointer to the [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object created. 8456 8457 8458### OH_Drawing_FontMgrDestroy() 8459 8460``` 8461void OH_Drawing_FontMgrDestroy (OH_Drawing_FontMgr* ) 8462``` 8463 8464**Description** 8465 8466Destroys an **OH_Drawing_FontMgr** object and reclaims the memory occupied by the object. 8467 8468**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8469 8470**Since**: 12 8471 8472**Parameters** 8473 8474| Name | Description | 8475| ------------------ | ------------------------------------------------------------ | 8476| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8477 8478 8479### OH_Drawing_FontMgrDestroyFamilyName() 8480 8481``` 8482void OH_Drawing_FontMgrDestroyFamilyName (char* familyName) 8483``` 8484 8485**Description** 8486 8487Reclaims the memory occupied by a font family name. 8488 8489**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8490 8491**Since**: 12 8492 8493**Parameters** 8494 8495| Name | Description | 8496| ---------- | ------------------------------ | 8497| familyName | Pointer to a font family name. | 8498 8499 8500### OH_Drawing_FontMgrDestroyFontStyleSet() 8501 8502``` 8503void OH_Drawing_FontMgrDestroyFontStyleSet (OH_Drawing_FontStyleSet* ) 8504``` 8505 8506**Description** 8507 8508Reclaims the memory occupied by a font style set. 8509 8510**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8511 8512**Since**: 12 8513 8514**Parameters** 8515 8516| Name | Description | 8517| ----------------------- | ------------------------------------------------------------ | 8518| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. | 8519 8520 8521### OH_Drawing_FontMgrGetFamilyCount() 8522 8523``` 8524int OH_Drawing_FontMgrGetFamilyCount (OH_Drawing_FontMgr* ) 8525``` 8526 8527**Description** 8528 8529Obtains the number of font families. 8530 8531**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8532 8533**Since**: 12 8534 8535**Parameters** 8536 8537| Name | Description | 8538| ------------------ | ------------------------------------------------------------ | 8539| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8540 8541**Returns** 8542 8543Returns the number of font families. 8544 8545 8546### OH_Drawing_FontMgrGetFamilyName() 8547 8548``` 8549char* OH_Drawing_FontMgrGetFamilyName (OH_Drawing_FontMgr* , int index ) 8550``` 8551 8552**Description** 8553 8554Obtains the font family name based on an index. 8555 8556**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8557 8558**Since**: 12 8559 8560**Parameters** 8561 8562| Name | Description | 8563| ------------------ | ------------------------------------------------------------ | 8564| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8565| index | Index of the font family name. | 8566 8567**Returns** 8568 8569Returns the font family name. 8570 8571 8572### OH_Drawing_FontMgrMatchFamily() 8573 8574``` 8575OH_Drawing_FontStyleSet* OH_Drawing_FontMgrMatchFamily (OH_Drawing_FontMgr* , const char* familyName ) 8576``` 8577 8578**Description** 8579 8580Obtains a font style set based on a font family name. 8581 8582**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8583 8584**Since**: 12 8585 8586**Parameters** 8587 8588| Name | Description | 8589| ------------------ | ------------------------------------------------------------ | 8590| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8591| familyName | Pointer to a font family name. | 8592 8593**Returns** 8594 8595Returns the pointer to the [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object obtained. 8596 8597 8598### OH_Drawing_FontMgrMatchFamilyStyle() 8599 8600``` 8601OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyle (OH_Drawing_FontMgr* , const char* familyName, OH_Drawing_FontStyleStruct ) 8602``` 8603 8604**Description** 8605 8606Obtains a typeface based on the font style information and font family name. 8607 8608**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8609 8610**Since**: 12 8611 8612**Parameters** 8613 8614| Name | Description | 8615| ------------------------------------------------------------ | ------------------------------------------------------------ | 8616| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8617| familyName | Pointer to a font family name. | 8618| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant. | 8619 8620**Returns** 8621 8622Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object obtained. 8623 8624 8625### OH_Drawing_FontMgrMatchFamilyStyleCharacter() 8626 8627``` 8628OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyleCharacter (OH_Drawing_FontMgr* , const char* familyName, OH_Drawing_FontStyleStruct , const char* bcp47[], int bcp47Count, int32_t character ) 8629``` 8630 8631**Description** 8632 8633Obtains a typeface for the specified character. 8634 8635**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8636 8637**Since**: 12 8638 8639**Parameters** 8640 8641| Name | Description | 8642| ------------------------------------------------------------ | ------------------------------------------------------------ | 8643| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). | 8644| familyName | Pointer to a font family name. | 8645| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant. | 8646| bcp47 | Pointer to the character language code array, which is a combination of ISO 639, 15924, and 3166-1 language codes. | 8647| bcp47Count | Size of the character language code array. | 8648| character | UTF8 character used for matching. | 8649 8650**Returns** 8651 8652Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object obtained. 8653 8654 8655### OH_Drawing_FontParserGetFontByName() 8656 8657``` 8658OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName (OH_Drawing_FontParser* , const char* ) 8659``` 8660 8661**Description** 8662 8663Obtains the descriptor of a system font based on the font name. 8664 8665**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8666 8667**Since**: 12 8668 8669**Parameters** 8670 8671| Name | Description | 8672| --------------------- | ------------------------------------------------------------ | 8673| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). | 8674| char\* | Pointer to the system font name. | 8675 8676**Returns** 8677 8678Returns the system font. 8679 8680 8681### OH_Drawing_FontParserGetSystemFontList() 8682 8683``` 8684char** OH_Drawing_FontParserGetSystemFontList (OH_Drawing_FontParser* , size_t* ) 8685``` 8686 8687**Description** 8688 8689Obtains the list of system fonts. This function can be used only on 2-in-1 devices. 8690 8691**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8692 8693**Since**: 12 8694 8695**Parameters** 8696 8697| Name | Description | 8698| --------------------- | ------------------------------------------------------------ | 8699| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). | 8700| size_t | Pointer to the number of system font names. | 8701 8702**Returns** 8703 8704Returns the system font list. 8705 8706 8707### OH_Drawing_FontSetFakeBoldText() 8708 8709``` 8710void OH_Drawing_FontSetFakeBoldText (OH_Drawing_Font* , bool isFakeBoldText ) 8711``` 8712 8713**Description** 8714 8715Sets fake bold for a font by increasing the stroke width. 8716 8717Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8718 8719If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8720 8721**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8722 8723**Since**: 11 8724 8725**Parameters** 8726 8727| Name | Description | 8728| --------------- | ------------------------------------------------------------ | 8729| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8730| isFakeBoldText | Whether to set fake bold. The value **true** means to set fake bold, and **false** means the opposite. | 8731 8732 8733### OH_Drawing_FontSetLinearText() 8734 8735``` 8736void OH_Drawing_FontSetLinearText (OH_Drawing_Font* , bool isLinearText ) 8737``` 8738 8739**Description** 8740 8741Sets linear scaling for a font. 8742 8743Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8744 8745If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8746 8747**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8748 8749**Since**: 11 8750 8751**Parameters** 8752 8753| Name | Description | 8754| --------------- | ------------------------------------------------------------ | 8755| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8756| isLinearText | Whether to enable linear scaling. The value **true** means to enable linear scaling, and **false** means the opposite. | 8757 8758 8759### OH_Drawing_FontSetTextSize() 8760 8761``` 8762void OH_Drawing_FontSetTextSize (OH_Drawing_Font* , float textSize ) 8763``` 8764 8765**Description** 8766 8767Sets the font size. 8768 8769Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8770 8771If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8772 8773**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8774 8775**Since**: 11 8776 8777**Parameters** 8778 8779| Name | Description | 8780| --------------- | ----------------------------------------- | 8781| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8782| textSize | Font size. | 8783 8784 8785### OH_Drawing_FontSetTextSkewX() 8786 8787``` 8788void OH_Drawing_FontSetTextSkewX (OH_Drawing_Font* , float skewX ) 8789``` 8790 8791**Description** 8792 8793Sets a horizontal skew factor for a font. 8794 8795Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8796 8797If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8798 8799**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8800 8801**Since**: 11 8802 8803**Parameters** 8804 8805| Name | Description | 8806| --------------- | ------------------------------------------ | 8807| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8808| skewX | Skew of the X axis relative to the Y axis. | 8809 8810 8811### OH_Drawing_FontSetTypeface() 8812 8813``` 8814void OH_Drawing_FontSetTypeface (OH_Drawing_Font* , OH_Drawing_Typeface* ) 8815``` 8816 8817**Description** 8818 8819Sets the typeface for a font. 8820 8821Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 8822 8823If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 8824 8825**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8826 8827**Since**: 11 8828 8829**Parameters** 8830 8831| Name | Description | 8832| ------------------- | ------------------------------------------------------------ | 8833| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 8834| OH_Drawing_Typeface | Pointer to an **OH_Drawing_Typeface** object. If NULL is passed in, the default **OH_Drawing_Typeface** object is used. | 8835 8836 8837### OH_Drawing_FontStyleSetCount() 8838 8839``` 8840int OH_Drawing_FontStyleSetCount (OH_Drawing_FontStyleSet* ) 8841``` 8842 8843**Description** 8844 8845Obtains the number of fonts in the font style set. 8846 8847**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8848 8849**Since**: 12 8850 8851**Parameters** 8852 8853| Name | Description | 8854| ----------------------- | ------------------------------------------------------------ | 8855| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. | 8856 8857**Returns** 8858 8859Returns the number of fonts. 8860 8861 8862### OH_Drawing_FontStyleSetCreateTypeface() 8863 8864``` 8865OH_Drawing_Typeface* OH_Drawing_FontStyleSetCreateTypeface (OH_Drawing_FontStyleSet* , int index ) 8866``` 8867 8868**Description** 8869 8870Creates a typeface for the specified index. 8871 8872**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8873 8874**Since**: 12 8875 8876**Parameters** 8877 8878| Name | Description | 8879| ----------------------- | ------------------------------------------------------------ | 8880| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. | 8881| index | Index of the typeface. | 8882 8883**Returns** 8884 8885Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created if the operation is successful; returns a null pointer otherwise. 8886 8887 8888### OH_Drawing_FontStyleSetFreeStyleName() 8889 8890``` 8891void OH_Drawing_FontStyleSetFreeStyleName (char** styleName) 8892``` 8893 8894**Description** 8895 8896Reclaims the memory occupied by a font style. 8897 8898**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8899 8900**Since**: 12 8901 8902**Parameters** 8903 8904| Name | Description | 8905| --------- | ------------------------------------------------------------ | 8906| styleName | Double pointer to the string that specifies the font style name. | 8907 8908 8909### OH_Drawing_FontStyleSetGetStyle() 8910 8911``` 8912OH_Drawing_FontStyleStruct OH_Drawing_FontStyleSetGetStyle (OH_Drawing_FontStyleSet* , int32_t index, char** styleName ) 8913``` 8914 8915**Description** 8916 8917Obtains the font style. 8918 8919**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8920 8921**Since**: 12 8922 8923**Parameters** 8924 8925| Name | Description | 8926| ----------------------- | ------------------------------------------------------------ | 8927| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. | 8928| index | Index of the font style. | 8929| styleName | Double pointer to the string that specifies the font style name. | 8930 8931**Returns** 8932 8933Returns the font style. 8934 8935 8936### OH_Drawing_FontStyleSetMatchStyle() 8937 8938``` 8939OH_Drawing_Typeface* OH_Drawing_FontStyleSetMatchStyle (OH_Drawing_FontStyleSet* , OH_Drawing_FontStyleStruct fontStyleStruct ) 8940``` 8941 8942**Description** 8943 8944Obtains the typeface closest to the font style. 8945 8946**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8947 8948**Since**: 12 8949 8950**Parameters** 8951 8952| Name | Description | 8953| ----------------------- | ------------------------------------------------------------ | 8954| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. | 8955| fontStyleStruct | Font style, including the font weight, width, and slant. | 8956 8957**Returns** 8958 8959Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object obtained. 8960 8961 8962### OH_Drawing_GetAffinityFromPositionAndAffinity() 8963 8964``` 8965int OH_Drawing_GetAffinityFromPositionAndAffinity (OH_Drawing_PositionAndAffinity* ) 8966``` 8967 8968**Description** 8969 8970Obtains the affinity attribute of an **OH_Drawing_PositionAndAffinity** object. The affinity determines whether the font is close to the front text or rear text. 8971 8972**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8973 8974**Since**: 11 8975 8976**Parameters** 8977 8978| Name | Description | 8979| ------------------------------ | ------------------------------------------------------------ | 8980| OH_Drawing_PositionAndAffinity | Pointer to an **OH_Drawing_PositionAndAffinity** object, which is obtained by calling [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) or [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster). | 8981 8982**Returns** 8983 8984Returns the affinity attribute. 8985 8986 8987### OH_Drawing_GetBottomFromTextBox() 8988 8989``` 8990float OH_Drawing_GetBottomFromTextBox (OH_Drawing_TextBox* , int ) 8991``` 8992 8993**Description** 8994 8995Obtains the bottom position of a text box. 8996 8997**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 8998 8999**Since**: 11 9000 9001**Parameters** 9002 9003| Name | Description | 9004| ------------------ | ------------------------------------------------------------ | 9005| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9006| int | Index of the text box. | 9007 9008**Returns** 9009 9010Returns the bottom position. 9011 9012 9013### OH_Drawing_GetEndFromRange() 9014 9015``` 9016size_t OH_Drawing_GetEndFromRange (OH_Drawing_Range* ) 9017``` 9018 9019**Description** 9020 9021Obtains the end position of an **OH_Drawing_Range** object. 9022 9023**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9024 9025**Since**: 11 9026 9027**Parameters** 9028 9029| Name | Description | 9030| ---------------- | ------------------------------------------------------------ | 9031| OH_Drawing_Range | Pointer to an **OH_Drawing_Range** object, which is obtained by calling [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary). | 9032 9033**Returns** 9034 9035Returns the end position. 9036 9037 9038### OH_Drawing_GetLeftFromTextBox() 9039 9040``` 9041float OH_Drawing_GetLeftFromTextBox (OH_Drawing_TextBox* , int ) 9042``` 9043 9044**Description** 9045 9046Obtains the left position of a text box. 9047 9048**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9049 9050**Since**: 11 9051 9052**Parameters** 9053 9054| Name | Description | 9055| ------------------ | ------------------------------------------------------------ | 9056| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9057| int | Index of the text box. | 9058 9059**Returns** 9060 9061Returns the left position. 9062 9063 9064### OH_Drawing_GetPositionFromPositionAndAffinity() 9065 9066``` 9067size_t OH_Drawing_GetPositionFromPositionAndAffinity (OH_Drawing_PositionAndAffinity* ) 9068``` 9069 9070**Description** 9071 9072Obtains the position attribute of an **OH_Drawing_PositionAndAffinity** object. 9073 9074**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9075 9076**Since**: 11 9077 9078**Parameters** 9079 9080| Name | Description | 9081| ------------------------------ | ------------------------------------------------------------ | 9082| OH_Drawing_PositionAndAffinity | Pointer to an **OH_Drawing_PositionAndAffinity** object, which is obtained by calling [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) or [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster). | 9083 9084**Returns** 9085 9086Returns the position attribute. 9087 9088 9089### OH_Drawing_GetRightFromTextBox() 9090 9091``` 9092float OH_Drawing_GetRightFromTextBox (OH_Drawing_TextBox* , int ) 9093``` 9094 9095**Description** 9096 9097Obtains the right position of a text box. 9098 9099**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9100 9101**Since**: 11 9102 9103**Parameters** 9104 9105| Name | Description | 9106| ------------------ | ------------------------------------------------------------ | 9107| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9108| int | Index of the text box. | 9109 9110**Returns** 9111 9112Returns the right position. 9113 9114 9115### OH_Drawing_GetSizeOfTextBox() 9116 9117``` 9118size_t OH_Drawing_GetSizeOfTextBox (OH_Drawing_TextBox* ) 9119``` 9120 9121**Description** 9122 9123Obtains the number of text boxes. 9124 9125**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9126 9127**Since**: 11 9128 9129**Parameters** 9130 9131| Name | Description | 9132| ------------------ | ------------------------------------------------------------ | 9133| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9134 9135**Returns** 9136 9137Returns the number of text boxes. 9138 9139 9140### OH_Drawing_GetStartFromRange() 9141 9142``` 9143size_t OH_Drawing_GetStartFromRange (OH_Drawing_Range* ) 9144``` 9145 9146**Description** 9147 9148Obtains the start position of an **OH_Drawing_Range** object. 9149 9150**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9151 9152**Since**: 11 9153 9154**Parameters** 9155 9156| Name | Description | 9157| ---------------- | ------------------------------------------------------------ | 9158| OH_Drawing_Range | Pointer to an **OH_Drawing_Range** object, which is obtained by calling [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary). | 9159 9160**Returns** 9161 9162Returns the start position. 9163 9164 9165### OH_Drawing_GetSystemFontConfigInfo() 9166 9167``` 9168OH_Drawing_FontConfigInfo* OH_Drawing_GetSystemFontConfigInfo (OH_Drawing_FontConfigInfoErrorCode* ) 9169``` 9170 9171**Description** 9172 9173Obtains the system font configuration. 9174 9175**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9176 9177**Since**: 12 9178 9179**Parameters** 9180 9181| Name | Description | 9182| --------------------------------- | ------------------------------------------------------------ | 9183| OH_Drawing_FontConfigJsonInfoCode | Pointer to the error code. For details about the available options, see [OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode). | 9184 9185**Returns** 9186 9187Returns the pointer to the system font configuration. 9188 9189 9190### OH_Drawing_GetTextDirectionFromTextBox() 9191 9192``` 9193int OH_Drawing_GetTextDirectionFromTextBox (OH_Drawing_TextBox* , int ) 9194``` 9195 9196**Description** 9197 9198Obtains the text direction of a text box. 9199 9200**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9201 9202**Since**: 11 9203 9204**Parameters** 9205 9206| Name | Description | 9207| ------------------ | ------------------------------------------------------------ | 9208| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9209| int | Index of the text box. | 9210 9211**Returns** 9212 9213Returns the text direction. 9214 9215 9216### OH_Drawing_GetTopFromTextBox() 9217 9218``` 9219float OH_Drawing_GetTopFromTextBox (OH_Drawing_TextBox* , int ) 9220``` 9221 9222**Description** 9223 9224Obtains the top position of a text box. 9225 9226**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9227 9228**Since**: 11 9229 9230**Parameters** 9231 9232| Name | Description | 9233| ------------------ | ------------------------------------------------------------ | 9234| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). | 9235| int | Index of the text box. | 9236 9237**Returns** 9238 9239Returns the top position. 9240 9241 9242### OH_Drawing_GpuContextCreateFromGL() 9243 9244``` 9245OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL (OH_Drawing_GpuContextOptions ) 9246``` 9247 9248**Description** 9249 9250Creates an **OH_Drawing_GpuContext** object that uses OpenGL as the backend interface. 9251 9252**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9253 9254**Since**: 12 9255 9256**Parameters** 9257 9258| Name | Description | 9259| ---------------------------- | ------------------------------------------------------------ | 9260| OH_Drawing_GpuContextOptions | GPU context option, which is an [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md) object. | 9261 9262**Returns** 9263 9264Returns the pointer to the [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object created. 9265 9266 9267### OH_Drawing_GpuContextDestroy() 9268 9269``` 9270void OH_Drawing_GpuContextDestroy (OH_Drawing_GpuContext* ) 9271``` 9272 9273**Description** 9274 9275Destroys an **OH_Drawing_GpuContext** object and reclaims the memory occupied by the object. 9276 9277**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9278 9279**Since**: 12 9280 9281**Parameters** 9282 9283| Name | Description | 9284| --------------------- | ------------------------------------------------------------ | 9285| OH_Drawing_GpuContext | Pointer to an [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object. | 9286 9287 9288### OH_Drawing_ImageBuildFromBitmap() 9289 9290``` 9291bool OH_Drawing_ImageBuildFromBitmap (OH_Drawing_Image* , OH_Drawing_Bitmap* ) 9292``` 9293 9294**Description** 9295 9296Builds an image from a bitmap by sharing or copying bitmap pixels. If the bitmap is marked as immutable, the pixel memory is shared, not copied. 9297 9298Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9299 9300If either **OH_Drawing_Image** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9301 9302**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9303 9304**Since**: 12 9305 9306**Parameters** 9307 9308| Name | Description | 9309| ----------------- | ------------------------------------------------------------ | 9310| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 9311| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object. | 9312 9313**Returns** 9314 9315Returns **true** if the image is built; returns **false** otherwise. 9316 9317 9318### OH_Drawing_ImageCreate() 9319 9320``` 9321OH_Drawing_Image* OH_Drawing_ImageCreate (void ) 9322``` 9323 9324**Description** 9325 9326Creates an **OH_Drawing_Image** object that describes an array of two-dimensional pixels to draw. 9327 9328**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9329 9330**Since**: 12 9331 9332**Returns** 9333 9334Returns the pointer to the [OH_Drawing_Image](#oh_drawing_image) object created. 9335 9336 9337### OH_Drawing_ImageDestroy() 9338 9339``` 9340void OH_Drawing_ImageDestroy (OH_Drawing_Image* ) 9341``` 9342 9343**Description** 9344 9345Destroys an **OH_Drawing_Image** object and reclaims the memory occupied by the object. 9346 9347**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9348 9349**Since**: 12 9350 9351**Parameters** 9352 9353| Name | Description | 9354| ---------------- | ----------------------------------------------------------- | 9355| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 9356 9357 9358### OH_Drawing_ImageGetHeight() 9359 9360``` 9361int32_t OH_Drawing_ImageGetHeight (OH_Drawing_Image* ) 9362``` 9363 9364**Description** 9365 9366Obtains the image height, that is, the number of pixel lines. 9367 9368Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9369 9370If **OH_Drawing_Image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9371 9372**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9373 9374**Since**: 12 9375 9376**Parameters** 9377 9378| Name | Description | 9379| ---------------- | ----------------------------------------------------------- | 9380| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 9381 9382**Returns** 9383 9384Returns the height. 9385 9386 9387### OH_Drawing_ImageGetImageInfo() 9388 9389``` 9390void OH_Drawing_ImageGetImageInfo (OH_Drawing_Image* , OH_Drawing_Image_Info* ) 9391``` 9392 9393**Description** 9394 9395Obtains the image information. After this function is called, the passed-in image information object is filled. 9396 9397Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9398 9399If either **OH_Drawing_Image** or **OH_Drawing_Image_Info** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9400 9401**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9402 9403**Since**: 12 9404 9405**Parameters** 9406 9407| Name | Description | 9408| --------------------- | ------------------------------------------------------------ | 9409| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 9410| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object, which is created by calling [OH_Drawing_Image_Info](_o_h___drawing___image___info.md). | 9411 9412 9413### OH_Drawing_ImageGetWidth() 9414 9415``` 9416int32_t OH_Drawing_ImageGetWidth (OH_Drawing_Image* ) 9417``` 9418 9419**Description** 9420 9421Obtains the image width, that is, the number of pixels in each line. 9422 9423Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9424 9425If **OH_Drawing_Image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9426 9427**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9428 9429**Since**: 12 9430 9431**Parameters** 9432 9433| Name | Description | 9434| ---------------- | ----------------------------------------------------------- | 9435| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 9436 9437**Returns** 9438 9439Returns the width. 9440 9441 9442### OH_Drawing_LineMetricsGetSize() 9443 9444``` 9445size_t OH_Drawing_LineMetricsGetSize (OH_Drawing_LineMetrics* ) 9446``` 9447 9448**Description** 9449 9450Obtains the number of lines. 9451 9452**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9453 9454**Since**: 12 9455 9456**Parameters** 9457 9458| Name | Description | 9459| ---------------------------------------------------------- | ------------------------------------------------------------ | 9460| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). | 9461 9462**Returns** 9463 9464Returns the number of lines. 9465 9466 9467### OH_Drawing_MaskFilterCreateBlur() 9468 9469``` 9470OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateBlur (OH_Drawing_BlurType blurType, float sigma, bool respectCTM ) 9471``` 9472 9473**Description** 9474 9475Creates an **OH_Drawing_MaskFilter** object with a given blur type. 9476 9477**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9478 9479**Since**: 11 9480 9481**Parameters** 9482 9483| Name | Description | 9484| ---------- | ------------------------------------------------------------ | 9485| blurType | Blur type. | 9486| sigma | Standard deviation of the Gaussian blur to apply. The value must be greater than 0. | 9487| respectCTM | Whether the blur's sigma is modified by the CTM. The default value is **true**. | 9488 9489**Returns** 9490 9491Returns the pointer to the **OH_Drawing_MaskFilter** object created. 9492 9493 9494### OH_Drawing_MaskFilterDestroy() 9495 9496``` 9497void OH_Drawing_MaskFilterDestroy (OH_Drawing_MaskFilter* ) 9498``` 9499 9500**Description** 9501 9502Destroys an **OH_Drawing_MaskFilter** object and reclaims the memory occupied by the object. 9503 9504**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9505 9506**Since**: 11 9507 9508**Parameters** 9509 9510| Name | Description | 9511| --------------------- | ----------------------------------------------- | 9512| OH_Drawing_MaskFilter | Pointer to an **OH_Drawing_MaskFilter** object. | 9513 9514 9515### OH_Drawing_MatrixConcat() 9516 9517``` 9518void OH_Drawing_MatrixConcat (OH_Drawing_Matrix* total, const OH_Drawing_Matrix* a, const OH_Drawing_Matrix* b ) 9519``` 9520 9521**Description** 9522 9523Multiplies two matrices to produce a new matrix. 9524 9525Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9526 9527If any of **total**, **a**, and **b** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9528 9529**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9530 9531**Since**: 12 9532 9533**Parameters** 9534 9535| Name | Description | 9536| ----- | ------------------------------------------------------------ | 9537| total | Pointer to the new matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9538| a | Pointer to the first matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9539| b | Pointer to the second matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9540 9541 9542### OH_Drawing_MatrixCreate() 9543 9544``` 9545OH_Drawing_Matrix* OH_Drawing_MatrixCreate (void ) 9546``` 9547 9548**Description** 9549 9550Creates an **OH_Drawing_Matrix** object. 9551 9552**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9553 9554**Since**: 11 9555 9556**Returns** 9557 9558Returns the pointer to the **OH_Drawing_Matrix** object created. 9559 9560 9561### OH_Drawing_MatrixCreateRotation() 9562 9563``` 9564OH_Drawing_Matrix* OH_Drawing_MatrixCreateRotation (float deg, float x, float y ) 9565``` 9566 9567**Description** 9568 9569Creates an **OH_Drawing_Matrix** with the rotation attribute. The matrix is obtained by rotating an identity matrix by a given degree around the rotation point (x, y). 9570 9571**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9572 9573**Since**: 12 9574 9575**Parameters** 9576 9577| Name | Description | 9578| ---- | ------------------------------------------------------------ | 9579| deg | Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation. | 9580| x | Coordinate point on the X axis. | 9581| y | Coordinate point on the Y axis. | 9582 9583**Returns** 9584 9585Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created. 9586 9587 9588### OH_Drawing_MatrixCreateScale() 9589 9590``` 9591OH_Drawing_Matrix* OH_Drawing_MatrixCreateScale (float sx, float sy, float px, float py ) 9592``` 9593 9594**Description** 9595 9596Creates an **OH_Drawing_Matrix** with the scale attribute. The matrix is obtained by scaling an identity matrix with the factor (sx, sy) at the rotation point (px, py). 9597 9598**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9599 9600**Since**: 12 9601 9602**Parameters** 9603 9604| Name | Description | 9605| ---- | ------------------------------- | 9606| sx | Scale factor on the X axis. | 9607| sy | Scale factor on the Y axis. | 9608| px | Coordinate point on the X axis. | 9609| py | Coordinate point on the Y axis. | 9610 9611**Returns** 9612 9613Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created. 9614 9615 9616### OH_Drawing_MatrixCreateTranslation() 9617 9618``` 9619OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation (float dx, float dy ) 9620``` 9621 9622**Description** 9623 9624Creates an **OH_Drawing_Matrix** with the translation attribute. The matrix is obtained by translating the identity matrix by the distance (dx, dy). 9625 9626**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9627 9628**Since**: 12 9629 9630**Parameters** 9631 9632| Name | Description | 9633| ---- | ------------------------------------ | 9634| dx | Distance to translate on the X axis. | 9635| dy | Distance to translate on the Y axis. | 9636 9637**Returns** 9638 9639Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created. 9640 9641 9642### OH_Drawing_MatrixDestroy() 9643 9644``` 9645void OH_Drawing_MatrixDestroy (OH_Drawing_Matrix* ) 9646``` 9647 9648**Description** 9649 9650Destroys an **OH_Drawing_Matrix** object and reclaims the memory occupied by the object. 9651 9652**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9653 9654**Since**: 11 9655 9656**Parameters** 9657 9658| Name | Description | 9659| ----------------- | ----------------------------------------- | 9660| OH_Drawing_Matrix | Pointer to an **OH_Drawing_Font** object. | 9661 9662 9663### OH_Drawing_MatrixGetValue() 9664 9665``` 9666float OH_Drawing_MatrixGetValue (OH_Drawing_Matrix* , int index ) 9667``` 9668 9669**Description** 9670 9671Obtains a matrix value of a given index, which ranges from 0 to 8. 9672 9673Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9674 9675If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9676 9677If **index** is less than 0 or greater than 8, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 9678 9679**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9680 9681**Since**: 12 9682 9683**Parameters** 9684 9685| Name | Description | 9686| ----------------- | ------------------------------------------------------------ | 9687| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9688| index | Index, which ranges from 0 to 8. | 9689 9690**Returns** 9691 9692Returns the matrix value. 9693 9694 9695### OH_Drawing_MatrixInvert() 9696 9697``` 9698bool OH_Drawing_MatrixInvert (OH_Drawing_Matrix* , OH_Drawing_Matrix* inverse ) 9699``` 9700 9701**Description** 9702 9703Inverts a matrix and returns the result. 9704 9705Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9706 9707If either **OH_Drawing_Matrix** or **inverse** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9708 9709**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9710 9711**Since**: 12 9712 9713**Parameters** 9714 9715| Name | Description | 9716| ----------------- | ------------------------------------------------------------ | 9717| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9718| inverse | Pointer to the matrix to invert, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. The object can be created by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate). | 9719 9720**Returns** 9721 9722Returns **true** if the matrix is reversible and the passed-in **inverse** is inverted; returns **false** otherwise. 9723 9724 9725### OH_Drawing_MatrixIsEqual() 9726 9727``` 9728bool OH_Drawing_MatrixIsEqual (OH_Drawing_Matrix* , OH_Drawing_Matrix* other ) 9729``` 9730 9731**Description** 9732 9733Checks whether two **OH_Drawing_Matrix** objects are equal. 9734 9735Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9736 9737If either **OH_Drawing_Matrix** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9738 9739**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9740 9741**Since**: 12 9742 9743**Parameters** 9744 9745| Name | Description | 9746| ----------------- | ------------------------------------------------------------ | 9747| OH_Drawing_Matrix | Pointer to a matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9748| other | Pointer to the other matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9749 9750**Returns** 9751 9752Returns **true** if the two matrices are equal; returns **false** otherwise. 9753 9754 9755### OH_Drawing_MatrixIsIdentity() 9756 9757``` 9758bool OH_Drawing_MatrixIsIdentity (OH_Drawing_Matrix* ) 9759``` 9760 9761**Description** 9762 9763Checks whether an **OH_Drawing_Matrix** object is an identity matrix. 9764 9765Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9766 9767If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9768 9769**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9770 9771**Since**: 12 9772 9773**Parameters** 9774 9775| Name | Description | 9776| ----------------- | ------------------------------------------------------------ | 9777| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9778 9779**Returns** 9780 9781Returns **true** if the matrix is an identity matrix; returns **false** otherwise. 9782 9783 9784### OH_Drawing_MatrixPostRotate() 9785 9786``` 9787void OH_Drawing_MatrixPostRotate (OH_Drawing_Matrix* , float degree, float px, float py ) 9788``` 9789 9790**Description** 9791 9792Post multiplies a matrix by an identity matrix that rotates a given degree around the rotation point (px, py). 9793 9794Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9795 9796If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9797 9798**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9799 9800**Since**: 12 9801 9802**Parameters** 9803 9804| Name | Description | 9805| ----------------- | ------------------------------------------------------------ | 9806| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9807| degree | Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation. | 9808| px | X coordinate of the rotation point. | 9809| py | Y coordinate of the rotation point. | 9810 9811 9812### OH_Drawing_MatrixPostScale() 9813 9814``` 9815void OH_Drawing_MatrixPostScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py ) 9816``` 9817 9818**Description** 9819 9820Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py). 9821 9822Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9823 9824If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9825 9826 9827**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9828 9829**Since**: 12 9830 9831**Parameters** 9832 9833| Name | Description | 9834| ----------------- | ------------------------------------------------------------ | 9835| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9836| sx | Scale factor on the X axis. | 9837| sy | Scale factor on the Y axis. | 9838| px | X coordinate of the scale point. | 9839| py | Y coordinate of the scale point. | 9840 9841 9842### OH_Drawing_MatrixPostTranslate() 9843 9844``` 9845void OH_Drawing_MatrixPostTranslate (OH_Drawing_Matrix* , float dx, float dy ) 9846``` 9847 9848**Description** 9849 9850Post multiplies a matrix by an identity matrix that translates by a given distance (dx, dy). 9851 9852Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9853 9854If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9855 9856 9857**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9858 9859**Since**: 12 9860 9861**Parameters** 9862 9863| Name | Description | 9864| ----------------- | ------------------------------------------------------------ | 9865| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9866| dx | Distance to translate on the X axis. | 9867| dy | Distance to translate on the Y axis. | 9868 9869 9870### OH_Drawing_MatrixPreRotate() 9871 9872``` 9873void OH_Drawing_MatrixPreRotate (OH_Drawing_Matrix* , float degree, float px, float py ) 9874``` 9875 9876**Description** 9877 9878Premultiplies a matrix by an identity matrix that rotates by a given degree around the rotation point (px, py). 9879 9880Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9881 9882If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9883 9884 9885**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9886 9887**Since**: 12 9888 9889**Parameters** 9890 9891| Name | Description | 9892| ----------------- | ------------------------------------------------------------ | 9893| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9894| degree | Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation. | 9895| px | X coordinate of the rotation point. | 9896| py | Y coordinate of the rotation point. | 9897 9898 9899### OH_Drawing_MatrixPreScale() 9900 9901``` 9902void OH_Drawing_MatrixPreScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py ) 9903``` 9904 9905**Description** 9906 9907Premultiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py). 9908 9909Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9910 9911If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9912 9913 9914**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9915 9916**Since**: 12 9917 9918**Parameters** 9919 9920| Name | Description | 9921| ----------------- | ------------------------------------------------------------ | 9922| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9923| sx | Scale factor on the X axis. | 9924| sy | Scale factor on the Y axis. | 9925| px | X coordinate of the scale point. | 9926| py | Y coordinate of the scale point. | 9927 9928 9929### OH_Drawing_MatrixPreTranslate() 9930 9931``` 9932void OH_Drawing_MatrixPreTranslate (OH_Drawing_Matrix* , float dx, float dy ) 9933``` 9934 9935**Description** 9936 9937Premultiplies a matrix by an identity matrix that translates by a given distance (dx, dy). 9938 9939Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9940 9941If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9942 9943**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9944 9945**Since**: 12 9946 9947**Parameters** 9948 9949| Name | Description | 9950| ----------------- | ------------------------------------------------------------ | 9951| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9952| dx | Distance to translate on the X axis. | 9953| dy | Distance to translate on the Y axis. | 9954 9955 9956### OH_Drawing_MatrixReset() 9957 9958``` 9959void OH_Drawing_MatrixReset (OH_Drawing_Matrix* ) 9960``` 9961 9962**Description** 9963 9964Resets a matrix to an identity matrix: | 1 0 0 | | 0 1 0 | | 0 0 0 1 |. 9965 9966Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9967 9968If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9969 9970**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9971 9972**Since**: 12 9973 9974**Parameters** 9975 9976| Name | Description | 9977| ----------------- | ------------------------------------------------------------ | 9978| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 9979 9980 9981### OH_Drawing_MatrixRotate() 9982 9983``` 9984void OH_Drawing_MatrixRotate (OH_Drawing_Matrix* , float degree, float px, float py ) 9985``` 9986 9987**Description** 9988 9989Sets a matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py). 9990 9991Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 9992 9993If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 9994 9995**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 9996 9997**Since**: 12 9998 9999**Parameters** 10000 10001| Name | Description | 10002| ----------------- | ------------------------------------------------------------ | 10003| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 10004| degree | Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation. | 10005| px | Coordinate point on the X axis. | 10006| py | Coordinate point on the Y axis. | 10007 10008 10009### OH_Drawing_MatrixScale() 10010 10011``` 10012void OH_Drawing_MatrixScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py ) 10013``` 10014 10015**Description** 10016 10017Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py). 10018 10019Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10020 10021If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10022 10023**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10024 10025**Since**: 12 10026 10027**Parameters** 10028 10029| Name | Description | 10030| ----------------- | ------------------------------------------------------------ | 10031| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 10032| sx | Scale factor on the X axis. | 10033| sy | Scale factor on the Y axis. | 10034| px | Coordinate point on the X axis. | 10035| py | Coordinate point on the Y axis. | 10036 10037 10038### OH_Drawing_MatrixSetMatrix() 10039 10040``` 10041void OH_Drawing_MatrixSetMatrix (OH_Drawing_Matrix* , float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2 ) 10042``` 10043 10044**Description** 10045 10046Sets matrix parameters for an **OH_Drawing_Matrix** object. 10047 10048Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10049 10050If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10051 10052**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10053 10054**Since**: 11 10055 10056**Parameters** 10057 10058| Name | Description | 10059| ----------------- | ------------------------------------------- | 10060| OH_Drawing_Matrix | Pointer to an **OH_Drawing_Matrix** object. | 10061| scaleX | Scale factor on the X axis. | 10062| skewX | Skew factor on the X axis. | 10063| transX | Translation coefficient on the X axis. | 10064| skewY | Skew factor on the Y axis. | 10065| scaleY | Scale factor on the Y axis. | 10066| transY | Translation coefficient on the Y axis. | 10067| persp0 | Perspective coefficient of the X axis. | 10068| persp1 | Perspective coefficient of the Y axis. | 10069| persp2 | Perspective scale coefficient. | 10070 10071 10072### OH_Drawing_MatrixSetPolyToPoly() 10073 10074``` 10075bool OH_Drawing_MatrixSetPolyToPoly (OH_Drawing_Matrix* , const OH_Drawing_Point2D* src, const OH_Drawing_Point2D* dst, uint32_t count ) 10076``` 10077 10078**Description** 10079 10080Generates a transformation matrix by setting source points and destination points. Both the number of source points and that of destination points must be in the range [0, 4]. 10081 10082Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10083 10084If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10085 10086If **count** is less than 0 or greater than 4, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10087 10088**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10089 10090**Since**: 12 10091 10092**Parameters** 10093 10094| Name | Description | 10095| ----------------- | ------------------------------------------------------------ | 10096| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 10097| src | Array of source points. If NULL is passed in, **count** must be 0. | 10098| dst | Array of destination points. The number of destination points must be the same as that of source points. If NULL is passed in, **count** must be 0. | 10099| count | Number of source points or destination points. If 0 is passed in, the matrix is set to an identity matrix. | 10100 10101**Returns** 10102 10103Returns **true** if the matrix is generated; returns **false** otherwise. 10104 10105 10106### OH_Drawing_MatrixSetRectToRect() 10107 10108``` 10109bool OH_Drawing_MatrixSetRectToRect (OH_Drawing_Matrix* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, OH_Drawing_ScaleToFit stf ) 10110``` 10111 10112**Description** 10113 10114Scales a matrix to map a source rectangle to a destination rectangle. 10115 10116Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10117 10118If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. 10119 10120**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10121 10122**Since**: 12 10123 10124**Parameters** 10125 10126| Name | Description | 10127| ----------------- | ------------------------------------------------------------ | 10128| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 10129| src | Pointer to a source rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10130| dst | Pointer to a destination rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10131| stf | Scaling mode. For details about the available options, see [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit). | 10132 10133**Returns** 10134 10135Returns **true** if the operation is successful; returns **false** if the operation fails; returns **true** and sets the matrix to |0 0 0| |0 0 0| |0 0 1| if the passed-in matrix is empty. 10136 10137### OH_Drawing_MatrixTranslate() 10138 10139``` 10140void OH_Drawing_MatrixTranslate (OH_Drawing_Matrix* , float dx, float dy ) 10141``` 10142 10143**Description** 10144 10145Sets a matrix as an identity matrix and translates it by a given distance (dx, dy). 10146 10147Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10148 10149If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10150 10151**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10152 10153**Since**: 12 10154 10155**Parameters** 10156 10157| Name | Description | 10158| ----------------- | ------------------------------------------------------------ | 10159| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 10160| dx | Distance to translate on the X axis. | 10161| dy | Distance to translate on the Y axis. | 10162 10163 10164### OH_Drawing_MemoryStreamCreate() 10165 10166``` 10167OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate (const void* data, size_t length, bool copyData ) 10168``` 10169 10170**Description** 10171 10172Creates an **OH_Drawing_MemoryStream** object. 10173 10174Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10175 10176If **data** is NULL or **length** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10177 10178**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10179 10180**Since**: 12 10181 10182**Parameters** 10183 10184| Name | Description | 10185| -------- | ------------------------------------------------------------ | 10186| data | Pointer to the data. | 10187| length | Length of the data. | 10188| copyData | Whether to copy data. The value **true** means that the **OH_Drawing_MemoryStream** object copies the data, and **false** means that the **OH_Drawing_MemoryStream** object directly uses the data without copying. | 10189 10190**Returns** 10191 10192Returns the pointer to the [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object created. 10193 10194 10195### OH_Drawing_MemoryStreamDestroy() 10196 10197``` 10198void OH_Drawing_MemoryStreamDestroy (OH_Drawing_MemoryStream* ) 10199``` 10200 10201**Description** 10202 10203Destroys an **OH_Drawing_MemoryStream** object and reclaims the memory occupied by the object. 10204 10205**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10206 10207**Since**: 12 10208 10209**Parameters** 10210 10211| Name | Description | 10212| ----------------------- | ------------------------------------------------------------ | 10213| OH_Drawing_MemoryStream | Pointer to an [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object. | 10214 10215 10216### OH_Drawing_PathAddArc() 10217 10218``` 10219void OH_Drawing_PathAddArc (OH_Drawing_Path* , const OH_Drawing_Rect* , float startAngle, float sweepAngle ) 10220``` 10221 10222**Description** 10223 10224Adds an arc to a path as the start of a new contour. The arc added is part of the ellipse bounded by oval, from the start angle through the sweep angle, measured in degrees. A positive angle indicates a clockwise sweep, and a negative angle indicates a counterclockwise sweep. If the sweep angle is less than or equal to -360°, or if the sweep angle is greater than or equal to 360° and start angle modulo 90 is nearly zero, an oval instead of an ellipse is added. 10225 10226Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10227 10228If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10229 10230**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10231 10232**Since**: 12 10233 10234**Parameters** 10235 10236| Name | Description | 10237| --------------- | ------------------------------------------------------------ | 10238| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10239| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10240| startAngle | Start angle of the arc, in degrees. | 10241| sweepAngle | Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by 360. | 10242 10243### OH_Drawing_PathAddOval() 10244 10245``` 10246void OH_Drawing_PathAddOval (OH_Drawing_Path* , const OH_Drawing_Rect* , OH_Drawing_PathDirection ) 10247``` 10248 10249**Description** 10250 10251Adds an oval to a path in the specified direction. 10252 10253Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10254If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10255 10256If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10257 10258**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10259 10260**Since**: 12 10261 10262**Parameters** 10263 10264| Name | Description | 10265| ------------------------ | ------------------------------------------------------------ | 10266| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10267| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10268| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). | 10269 10270### OH_Drawing_PathAddOvalWithInitialPoint() 10271 10272 10273``` 10274void OH_Drawing_PathAddOvalWithInitialPoint (OH_Drawing_Path* , const OH_Drawing_Rect* , uint32_t start, OH_Drawing_PathDirection ) 10275``` 10276 10277**Description** 10278 10279Adds an oval to a path. **OH_Drawing_Rect** specifies the outer tangent rectangle of the oval, and **OH_Drawing_PathDirection** specifies whether the drawing is clockwise or anticlockwise. 10280 10281Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10282 10283If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10284 10285If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10286 10287**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10288 10289**Since**: 12 10290 10291**Parameters** 10292 10293| Name | Description | 10294| ------------------------ | ------------------------------------------------------------ | 10295| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10296| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10297| start | Start point of the oval. | 10298| OH_Drawing_PathDirection | Direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). | 10299 10300 10301### OH_Drawing_PathAddPath() 10302 10303``` 10304void OH_Drawing_PathAddPath (OH_Drawing_Path* , const OH_Drawing_Path* src, const OH_Drawing_Matrix* ) 10305``` 10306 10307**Description** 10308 10309Transforms the points in a **src** path by a matrix and adds the new one to the current path. 10310 10311Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10312 10313If either **OH_Drawing_Path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10314 10315**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10316 10317**Since**: 12 10318 10319**Parameters** 10320 10321| Name | Description | 10322| ----------------- | ------------------------------------------------------------ | 10323| OH_Drawing_Path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10324| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10325| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If NULL is passed in, it is the identity matrix. | 10326 10327 10328### OH_Drawing_PathAddPathWithMatrixAndMode() 10329 10330``` 10331void OH_Drawing_PathAddPathWithMatrixAndMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, const OH_Drawing_Matrix* , OH_Drawing_PathAddMode ) 10332``` 10333 10334**Description** 10335 10336Transforms the points in a **src** path by a matrix and adds the new one to the current path with the specified adding mode. 10337 10338Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10339 10340If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10341 10342If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10343 10344**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10345 10346**Since**: 12 10347 10348**Parameters** 10349 10350| Name | Description | 10351| ---------------------- | ------------------------------------------------------------ | 10352| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10353| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10354| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If NULL is passed in, it is the identity matrix. | 10355| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). | 10356 10357 10358### OH_Drawing_PathAddPathWithMode() 10359 10360``` 10361void OH_Drawing_PathAddPathWithMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, OH_Drawing_PathAddMode ) 10362``` 10363 10364**Description** 10365 10366Adds a **src** path to the current path with the specified adding mode. 10367 10368Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10369 10370If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10371 10372If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10373 10374**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10375 10376**Since**: 12 10377 10378**Parameters** 10379 10380| Name | Description | 10381| ---------------------- | ------------------------------------------------------------ | 10382| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10383| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10384| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). | 10385 10386 10387### OH_Drawing_PathAddPathWithOffsetAndMode() 10388 10389``` 10390void OH_Drawing_PathAddPathWithOffsetAndMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, float dx, float dy, OH_Drawing_PathAddMode ) 10391``` 10392 10393**Description** 10394 10395Translates a **src** path by an offset and adds the new one to the current path with the specified adding mode. 10396 10397Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10398 10399If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10400 10401If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10402 10403**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10404 10405**Since**: 12 10406 10407**Parameters** 10408 10409| Name | Description | 10410| ---------------------- | ------------------------------------------------------------ | 10411| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10412| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10413| dx | X offset. | 10414| dy | Y offset. | 10415| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). | 10416 10417 10418### OH_Drawing_PathAddRect() 10419 10420``` 10421void OH_Drawing_PathAddRect (OH_Drawing_Path* , float left, float top, float right, float bottom, OH_Drawing_PathDirection ) 10422``` 10423 10424**Description** 10425 10426Adds a rectangle contour to a path in the specified direction. 10427 10428Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10429 10430If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10431 10432If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10433 10434**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10435 10436**Since**: 12 10437 10438**Parameters** 10439 10440| Name | Description | 10441| ------------------------ | ------------------------------------------------------------ | 10442| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10443| left | X coordinate of the upper left corner of the rectangle. | 10444| top | Y coordinate of the upper left corner of the rectangle. | 10445| right | X coordinate of the lower right corner of the rectangle. | 10446| bottom | Y coordinate of the lower right corner of the rectangle. | 10447| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). | 10448 10449 10450### OH_Drawing_PathAddRectWithInitialCorner() 10451 10452``` 10453void OH_Drawing_PathAddRectWithInitialCorner (OH_Drawing_Path* , const OH_Drawing_Rect* , OH_Drawing_PathDirection , uint32_t start ) 10454``` 10455 10456**Description** 10457 10458Adds a rectangle contour to a path in the specified direction. 10459 10460Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10461 10462If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10463 10464If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10465 10466**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10467 10468**Since**: 12 10469 10470**Parameters** 10471 10472| Name | Description | 10473| ------------------------ | ------------------------------------------------------------ | 10474| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10475| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. | 10476| OH_Drawing_PathDirection | Direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). | 10477| start | Start point, indicating the corner of the rectangle from which the path is drawn. The value **0** means the upper left corner, **1** means the upper right corner, **2** means the lower right corner, and **3** means the lower left corner. | 10478 10479 10480### OH_Drawing_PathAddRoundRect() 10481 10482``` 10483void OH_Drawing_PathAddRoundRect (OH_Drawing_Path* , const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection ) 10484``` 10485 10486**Description** 10487 10488Adds a rounded rectangle to a path in the specified direction. 10489 10490Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10491 10492If either **OH_Drawing_Path** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10493 10494If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 10495 10496**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10497 10498**Since**: 12 10499 10500**Parameters** 10501 10502| Name | Description | 10503| ------------------------ | ------------------------------------------------------------ | 10504| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10505| roundRect | Pointer to an [OH_Drawing_RoundRect](#oh_drawing_roundrect) object. | 10506| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). | 10507 10508 10509### OH_Drawing_PathArcTo() 10510 10511``` 10512void OH_Drawing_PathArcTo (OH_Drawing_Path* , float x1, float y1, float x2, float y2, float startDeg, float sweepDeg ) 10513``` 10514 10515**Description** 10516 10517Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle that encloses an ellipse is specified first, and then a start angle and a sweep angle are specified. The arc is a portion of the ellipse defined by the start angle and the sweep angle. By default, a line segment from the last point of the path to the start point of the arc is also added. 10518 10519Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10520 10521If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10522 10523**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10524 10525**Since**: 8 10526 10527**Parameters** 10528 10529| Name | Description | 10530| --------------- | ------------------------------------------------------------ | 10531| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10532| x1 | X coordinate of the upper left corner of the rectangle. | 10533| y1 | Y coordinate of the upper left corner of the rectangle. | 10534| x2 | X coordinate of the lower right corner of the rectangle. | 10535| y2 | Y coordinate of the lower right corner of the rectangle. | 10536| startDeg | Start angle. The start direction (0°) of the angle is the positive direction of the X axis. | 10537| sweepDeg | Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by 360. | 10538 10539 10540### OH_Drawing_PathClose() 10541 10542``` 10543void OH_Drawing_PathClose (OH_Drawing_Path* ) 10544``` 10545 10546**Description** 10547 10548Closes a path by drawing a line segment from the current point to the start point of the path. 10549 10550Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10551 10552If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10553 10554**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10555 10556**Since**: 8 10557 10558**Parameters** 10559 10560| Name | Description | 10561| --------------- | ----------------------------------------- | 10562| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10563 10564 10565### OH_Drawing_PathConicTo() 10566 10567``` 10568void OH_Drawing_PathConicTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY, float weight ) 10569``` 10570 10571**Description** 10572 10573Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. 10574 10575Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10576 10577If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10578 10579**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10580 10581**Since**: 12 10582 10583**Parameters** 10584 10585| Name | Description | 10586| --------------- | ------------------------------------------------------------ | 10587| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10588| ctrlX | X coordinate of the control point. | 10589| ctrlY | Y coordinate of the control point. | 10590| endX | X coordinate of the target point. | 10591| endY | Y coordinate of the target point. | 10592| weight | Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the control point. If the value is less than or equal to 0, this function is equivalent to [OH_Drawing_PathLineTo](#oh_drawing_pathlineto), that is, adding a line segment from the last point of the path to the target point. If the value is 1, this function is equivalent to [OH_Drawing_PathQuadTo](#oh_drawing_pathquadto). | 10593 10594 10595### OH_Drawing_PathContains() 10596 10597``` 10598bool OH_Drawing_PathContains (OH_Drawing_Path* , float x, float y ) 10599``` 10600 10601**Description** 10602 10603Checks whether a coordinate point is included in this path. For details, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype-1). 10604 10605Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10606 10607If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10608 10609**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10610 10611**Since**: 12 10612 10613**Parameters** 10614 10615| Name | Description | 10616| --------------- | --------------------------------------------------------- | 10617| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10618| x | Coordinate point on the X axis. | 10619| y | Coordinate point on the Y axis. | 10620 10621**Returns** 10622 10623Returns **true** if the coordinate point is included in the path; returns **false** otherwise. 10624 10625 10626### OH_Drawing_PathCopy() 10627 10628``` 10629OH_Drawing_Path* OH_Drawing_PathCopy (OH_Drawing_Path* ) 10630``` 10631 10632**Description** 10633 10634Copies an existing [OH_Drawing_Path](#oh_drawing_path) object to create a new one. 10635 10636Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10637 10638If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10639 10640**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10641 10642**Since**: 12 10643 10644**Parameters** 10645 10646| Name | Description | 10647| --------------- | --------------------------------------------------------- | 10648| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10649 10650**Returns** 10651 10652Returns the pointer to the [OH_Drawing_Path](#oh_drawing_path) object created. 10653 10654 10655### OH_Drawing_PathCreate() 10656 10657``` 10658OH_Drawing_Path* OH_Drawing_PathCreate (void ) 10659``` 10660 10661**Description** 10662 10663Creates an **OH_Drawing_Path** object. 10664 10665**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10666 10667**Since**: 8 10668 10669**Returns** 10670 10671Returns the pointer to the **OH_Drawing_Path** object created. 10672 10673 10674### OH_Drawing_PathCubicTo() 10675 10676``` 10677void OH_Drawing_PathCubicTo (OH_Drawing_Path* , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY ) 10678``` 10679 10680**Description** 10681 10682Draws a cubic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. 10683 10684Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10685 10686If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10687 10688**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10689 10690**Since**: 8 10691 10692**Parameters** 10693 10694| Name | Description | 10695| --------------- | ----------------------------------------- | 10696| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10697| ctrlX1 | X coordinate of the first control point. | 10698| ctrlY1 | Y coordinate of the first control point. | 10699| ctrlX2 | X coordinate of the second control point. | 10700| ctrlY2 | Y coordinate of the second control point. | 10701| endX | X coordinate of the target point. | 10702| endY | Y coordinate of the target point. | 10703 10704 10705### OH_Drawing_PathDestroy() 10706 10707``` 10708void OH_Drawing_PathDestroy (OH_Drawing_Path* ) 10709``` 10710 10711**Description** 10712 10713Destroys an **OH_Drawing_Path** object and reclaims the memory occupied by the object. 10714 10715**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10716 10717**Since**: 8 10718 10719**Parameters** 10720 10721| Name | Description | 10722| --------------- | ----------------------------------------- | 10723| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10724 10725 10726### OH_Drawing_PathEffectDestroy() 10727 10728``` 10729void OH_Drawing_PathEffectDestroy (OH_Drawing_PathEffect* ) 10730``` 10731 10732**Description** 10733 10734Destroys an **OH_Drawing_PathEffect** object and reclaims the memory occupied by the object. 10735 10736**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10737 10738**Since**: 12 10739 10740**Parameters** 10741 10742| Name | Description | 10743| --------------------- | ------------------------------------------------------------ | 10744| OH_Drawing_PathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. | 10745 10746 10747### OH_Drawing_PathGetLength() 10748 10749``` 10750float OH_Drawing_PathGetLength (OH_Drawing_Path* , bool forceClosed ) 10751``` 10752 10753**Description** 10754 10755Obtains the length of a path. 10756 10757Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10758 10759If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10760 10761**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10762 10763**Since**: 12 10764 10765**Parameters** 10766 10767| Name | Description | 10768| --------------- | ------------------------------------------------------------ | 10769| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10770| forceClosed | Whether the path can be modified or deleted freely after the function is called. The value **true** means that the path can be modified or deleted freely, and **false** means the opposite. | 10771 10772**Returns** 10773 10774Returns the length of the path. 10775 10776 10777### OH_Drawing_PathLineTo() 10778 10779``` 10780void OH_Drawing_PathLineTo (OH_Drawing_Path* , float x, float y ) 10781``` 10782 10783**Description** 10784 10785Draws a line segment from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. 10786 10787Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10788 10789If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10790 10791**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10792 10793**Since**: 8 10794 10795**Parameters** 10796 10797| Name | Description | 10798| --------------- | ----------------------------------------- | 10799| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10800| x | X coordinate of the target point. | 10801| y | Y coordinate of the target point. | 10802 10803 10804### OH_Drawing_PathMoveTo() 10805 10806``` 10807void OH_Drawing_PathMoveTo (OH_Drawing_Path* , float x, float y ) 10808``` 10809 10810**Description** 10811 10812Sets the start point of a path. 10813 10814Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10815 10816If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10817 10818**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10819 10820**Since**: 8 10821 10822**Parameters** 10823 10824| Name | Description | 10825| --------------- | ----------------------------------------- | 10826| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10827| x | X coordinate of the start point. | 10828| y | Y coordinate of the start point. | 10829 10830 10831### OH_Drawing_PathOffset() 10832 10833``` 10834void OH_Drawing_PathOffset (OH_Drawing_Path* path, OH_Drawing_Path* dst, float dx, float dy ) 10835``` 10836 10837**Description** 10838 10839Translates a path by an offset along the X axis and Y axis and adds the new one to the **dst** path. 10840 10841Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10842 10843If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10844 10845**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10846 10847**Since**: 12 10848 10849**Parameters** 10850 10851| Name | Description | 10852| ---- | ------------------------------------------------------------ | 10853| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 10854| dst | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object. If NULL is passed in, the result is stored in the current path. | 10855| dx | X offset. | 10856| dy | Y offset. | 10857 10858 10859### OH_Drawing_PathQuadTo() 10860 10861``` 10862void OH_Drawing_PathQuadTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY ) 10863``` 10864 10865**Description** 10866 10867Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used. 10868 10869Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10870 10871If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10872 10873**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10874 10875**Since**: 8 10876 10877**Parameters** 10878 10879| Name | Description | 10880| --------------- | ----------------------------------------- | 10881| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10882| ctrlX | X coordinate of the control point. | 10883| ctrlY | Y coordinate of the control point. | 10884| endX | X coordinate of the target point. | 10885| endY | Y coordinate of the target point. | 10886 10887 10888### OH_Drawing_PathRConicTo() 10889 10890``` 10891void OH_Drawing_PathRConicTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY, float weight ) 10892``` 10893 10894**Description** 10895 10896Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. 10897 10898Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10899 10900If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10901 10902**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10903 10904**Since**: 12 10905 10906**Parameters** 10907 10908| Name | Description | 10909| --------------- | ------------------------------------------------------------ | 10910| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10911| ctrlX | X offset relative to the last point, which is used to specify the X coordinate of the control point. | 10912| ctrlY | Y offset relative to the last point, which is used to specify the Y coordinate of the control point. | 10913| endX | X offset relative to the last point, which is used to specify the X coordinate of the target point. | 10914| endY | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. | 10915| weight | Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the control point. If the value is less than or equal to 0, this function is equivalent to [OH_Drawing_PathRLineTo](#oh_drawing_pathrlineto), that is, adding a line segment from the last point of the path to the target point. If the value is 1, this function is equivalent to [OH_Drawing_PathRQuadTo](#oh_drawing_pathrquadto). | 10916 10917 10918### OH_Drawing_PathRCubicTo() 10919 10920``` 10921void OH_Drawing_PathRCubicTo (OH_Drawing_Path* , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY ) 10922``` 10923 10924**Description** 10925 10926Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. 10927 10928Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10929 10930If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10931 10932**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10933 10934**Since**: 12 10935 10936**Parameters** 10937 10938| Name | Description | 10939| --------------- | ------------------------------------------------------------ | 10940| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10941| ctrlX1 | X offset relative to the last point, which is used to specify the X coordinate of the first control point. | 10942| ctrlY1 | Y offset relative to the last point, which is used to specify the Y coordinate of the first control point. | 10943| ctrlX2 | X offset relative to the last point, which is used to specify the X coordinate of the second control point. | 10944| ctrlY2 | Y offset relative to the last point, which is used to specify the Y coordinate of the second control point. | 10945| endX | X offset relative to the last point, which is used to specify the X coordinate of the target point. | 10946| endY | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. | 10947 10948 10949### OH_Drawing_PathReset() 10950 10951``` 10952void OH_Drawing_PathReset (OH_Drawing_Path* ) 10953``` 10954 10955**Description** 10956 10957Resets path data. 10958 10959Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10960 10961If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10962 10963**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10964 10965**Since**: 8 10966 10967**Parameters** 10968 10969| Name | Description | 10970| --------------- | ----------------------------------------- | 10971| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. | 10972 10973 10974### OH_Drawing_PathRLineTo() 10975 10976``` 10977void OH_Drawing_PathRLineTo (OH_Drawing_Path* , float x, float y ) 10978``` 10979 10980**Description** 10981 10982Draws a line segment from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. 10983 10984Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 10985 10986If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 10987 10988**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 10989 10990**Since**: 12 10991 10992**Parameters** 10993 10994| Name | Description | 10995| --------------- | ------------------------------------------------------------ | 10996| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 10997| x | X offset relative to the last point, which is used to specify the X coordinate of the target point. | 10998| y | Y offset relative to the last point, which is used to specify the X coordinate of the target point. | 10999 11000 11001### OH_Drawing_PathRMoveTo() 11002 11003``` 11004void OH_Drawing_PathRMoveTo (OH_Drawing_Path* , float x, float y ) 11005``` 11006 11007**Description** 11008 11009Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is used. 11010 11011Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11012 11013If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11014 11015**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11016 11017**Since**: 12 11018 11019**Parameters** 11020 11021| Name | Description | 11022| --------------- | ------------------------------------------------------------ | 11023| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 11024| x | X offset relative to the last point, which is used to specify the X coordinate of the start point. | 11025| y | Y offset relative to the last point, which is used to specify the Y coordinate of the start point. | 11026 11027 11028### OH_Drawing_PathRQuadTo() 11029 11030``` 11031void OH_Drawing_PathRQuadTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY ) 11032``` 11033 11034**Description** 11035 11036Draws a quadratic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used. 11037 11038Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11039 11040If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11041 11042**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11043 11044**Since**: 12 11045 11046**Parameters** 11047 11048| Name | Description | 11049| --------------- | ------------------------------------------------------------ | 11050| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 11051| ctrlX | X offset relative to the last point, which is used to specify the X coordinate of the control point. | 11052| ctrlY | Y offset relative to the last point, which is used to specify the Y coordinate of the control point. | 11053| endX | X offset relative to the last point, which is used to specify the X coordinate of the target point. | 11054| endY | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. | 11055 11056 11057### OH_Drawing_PathSetFillType() 11058 11059``` 11060void OH_Drawing_PathSetFillType (OH_Drawing_Path* , OH_Drawing_PathFillType ) 11061``` 11062 11063**Description** 11064 11065Sets the fill type for a path. 11066 11067Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11068 11069If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11070 11071If **OH_Drawing_PathFillType** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 11072 11073**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11074 11075**Since**: 12 11076 11077**Parameters** 11078 11079| Name | Description | 11080| ----------------------- | ------------------------------------------------------------ | 11081| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 11082| OH_Drawing_PathFillType | Fill type of the path. For details about the available options, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype). | 11083 11084 11085### OH_Drawing_PathTransform() 11086 11087``` 11088void OH_Drawing_PathTransform (OH_Drawing_Path* , const OH_Drawing_Matrix* ) 11089``` 11090 11091**Description** 11092 11093Transforms the points in a path by a matrix. 11094 11095Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11096 11097If either **OH_Drawing_Path** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11098 11099**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11100 11101**Since**: 12 11102 11103**Parameters** 11104 11105| Name | Description | 11106| ----------------- | ------------------------------------------------------------ | 11107| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 11108| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 11109 11110 11111### OH_Drawing_PathTransformWithPerspectiveClip() 11112 11113``` 11114void OH_Drawing_PathTransformWithPerspectiveClip (OH_Drawing_Path* src, const OH_Drawing_Matrix* , OH_Drawing_Path* dst, bool applyPerspectiveClip ) 11115``` 11116 11117**Description** 11118 11119Transforms the points in a **src** path by a matrix and uses the new one to replace the **dst** path. If the **dst** path does not exist, the **src** path is replaced. 11120 11121Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11122 11123If either **src** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11124 11125**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11126 11127**Since**: 12 11128 11129**Parameters** 11130 11131| Name | Description | 11132| -------------------- | ------------------------------------------------------------ | 11133| src | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. | 11134| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. | 11135| dst | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object. | 11136| applyPerspectiveClip | Whether to apply perspective cropping to the new path. The value **true** means to apply perspective cropping, and **false** means the opposite. | 11137 11138 11139### OH_Drawing_PenCreate() 11140 11141``` 11142OH_Drawing_Pen* OH_Drawing_PenCreate (void ) 11143``` 11144 11145**Description** 11146 11147Creates an **OH_Drawing_Pen** object. 11148 11149**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11150 11151**Since**: 8 11152 11153**Returns** 11154 11155Returns the pointer to the **OH_Drawing_Pen** object created. 11156 11157 11158### OH_Drawing_PenDestroy() 11159 11160``` 11161void OH_Drawing_PenDestroy (OH_Drawing_Pen* ) 11162``` 11163 11164**Description** 11165 11166Destroys an **OH_Drawing_Pen** object and reclaims the memory occupied by the object. 11167 11168**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11169 11170**Since**: 8 11171 11172**Parameters** 11173 11174| Name | Description | 11175| -------------- | ---------------------------------------- | 11176| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11177 11178 11179### OH_Drawing_PenGetAlpha() 11180 11181``` 11182uint8_t OH_Drawing_PenGetAlpha (const OH_Drawing_Pen* ) 11183``` 11184 11185**Description** 11186 11187Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape. 11188 11189Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11190 11191If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11192 11193**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11194 11195**Since**: 11 11196 11197**Parameters** 11198 11199| Name | Description | 11200| -------------- | ---------------------------------------- | 11201| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11202 11203**Returns** 11204 11205Returns an 8-bit variable that describes the alpha value. 11206 11207 11208### OH_Drawing_PenGetCap() 11209 11210``` 11211OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen* ) 11212``` 11213 11214**Description** 11215 11216Obtains the line cap style of a pen. 11217 11218Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11219 11220If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11221 11222**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11223 11224**Since**: 8 11225 11226**Parameters** 11227 11228| Name | Description | 11229| -------------- | ---------------------------------------- | 11230| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11231 11232**Returns** 11233 11234Returns the line cap style. 11235 11236 11237### OH_Drawing_PenGetColor() 11238 11239``` 11240uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen* ) 11241``` 11242 11243**Description** 11244 11245Obtains the color of a pen. The color is used by the pen to outline a shape. 11246 11247Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11248 11249If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11250 11251**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11252 11253**Since**: 8 11254 11255**Parameters** 11256 11257| Name | Description | 11258| -------------- | ---------------------------------------- | 11259| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11260 11261**Returns** 11262 11263Returns a 32-bit (ARGB) variable that describes the color. 11264 11265 11266### OH_Drawing_PenGetFilter() 11267 11268``` 11269void OH_Drawing_PenGetFilter (OH_Drawing_Pen* , OH_Drawing_Filter* ) 11270``` 11271 11272**Description** 11273 11274Obtains the filter of a pen. The filter is a container that holds a mask filter and color filter. 11275 11276Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11277 11278If either **OH_Drawing_Pen** or **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11279 11280**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11281 11282**Since**: 12 11283 11284**Parameters** 11285 11286| Name | Description | 11287| ----------------- | ------------------------------------------------------------ | 11288| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11289| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. | 11290 11291 11292### OH_Drawing_PenGetJoin() 11293 11294``` 11295OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen* ) 11296``` 11297 11298**Description** 11299 11300Obtains the line join style of a pen. 11301 11302Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11303 11304If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11305 11306**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11307 11308**Since**: 8 11309 11310**Parameters** 11311 11312| Name | Description | 11313| -------------- | ---------------------------------------- | 11314| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11315 11316**Returns** 11317 11318Returns the line join style. 11319 11320### OH_Drawing_PenGetMiterLimit() 11321 11322``` 11323float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen* ) 11324``` 11325 11326**Description** 11327 11328Obtains the stroke miter limit of a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded. 11329 11330Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11331 11332If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11333 11334**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11335 11336**Since**: 8 11337 11338**Parameters** 11339 11340| Name | Description | 11341| -------------- | ---------------------------------------- | 11342| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11343 11344**Returns** 11345 11346Returns the miter limit. 11347 11348 11349### OH_Drawing_PenGetWidth() 11350 11351``` 11352float OH_Drawing_PenGetWidth (const OH_Drawing_Pen* ) 11353``` 11354 11355**Description** 11356 11357Obtains the width of a pen. The width describes the thickness of the outline of a shape. 11358 11359Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11360 11361If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11362 11363**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11364 11365**Since**: 8 11366 11367**Parameters** 11368 11369| Name | Description | 11370| -------------- | ---------------------------------------- | 11371| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11372 11373**Returns** 11374 11375Returns the width of the pen. 11376 11377 11378### OH_Drawing_PenIsAntiAlias() 11379 11380``` 11381bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen* ) 11382``` 11383 11384**Description** 11385 11386Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent. 11387 11388Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11389 11390If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11391 11392**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11393 11394**Since**: 8 11395 11396**Parameters** 11397 11398| Name | Description | 11399| -------------- | ---------------------------------------- | 11400| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11401 11402**Returns** 11403 11404Returns **true** if anti-aliasing is enabled; returns **false** otherwise. 11405 11406 11407### OH_Drawing_PenReset() 11408 11409``` 11410void OH_Drawing_PenReset (OH_Drawing_Pen* ) 11411``` 11412 11413**Description** 11414 11415Resets a pen to the initial state. 11416 11417Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11418 11419If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11420 11421**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11422 11423**Since**: 12 11424 11425**Parameters** 11426 11427| Name | Description | 11428| -------------- | ------------------------------------------------------- | 11429| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11430 11431 11432### OH_Drawing_PenSetAlpha() 11433 11434``` 11435void OH_Drawing_PenSetAlpha (OH_Drawing_Pen* , uint8_t alpha ) 11436``` 11437 11438**Description** 11439 11440Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape. 11441 11442Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11443 11444If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11445 11446**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11447 11448**Since**: 11 11449 11450**Parameters** 11451 11452| Name | Description | 11453| -------------- | ---------------------------------------- | 11454| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11455| alpha | Alpha value, which is an 8-bit variable. | 11456 11457 11458### OH_Drawing_PenSetAntiAlias() 11459 11460``` 11461void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen* , bool ) 11462``` 11463 11464**Description** 11465 11466Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent. 11467 11468Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11469 11470If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11471 11472**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11473 11474**Since**: 8 11475 11476**Parameters** 11477 11478| Name | Description | 11479| -------------- | ------------------------------------------------------------ | 11480| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11481| bool | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite. | 11482 11483 11484### OH_Drawing_PenSetBlendMode() 11485 11486``` 11487void OH_Drawing_PenSetBlendMode (OH_Drawing_Pen* , OH_Drawing_BlendMode ) 11488``` 11489 11490**Description** 11491 11492Sets a blender for a pen. The blender implements the specified blend mode. 11493 11494Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11495 11496If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11497 11498If **OH_Drawing_BlendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 11499 11500**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11501 11502**Since**: 12 11503 11504**Parameters** 11505 11506| Name | Description | 11507| -------------------- | ------------------------------------------------------------ | 11508| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11509| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). | 11510 11511 11512### OH_Drawing_PenSetCap() 11513 11514``` 11515void OH_Drawing_PenSetCap (OH_Drawing_Pen* , OH_Drawing_PenLineCapStyle ) 11516``` 11517 11518**Description** 11519 11520Sets the line cap style for a pen. 11521 11522Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11523 11524If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11525 11526If **OH_Drawing_PenLineCapStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 11527 11528**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11529 11530**Since**: 8 11531 11532**Parameters** 11533 11534| Name | Description | 11535| -------------------------- | ---------------------------------------- | 11536| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11537| OH_Drawing_PenLineCapStyle | Line cap style, which is a variable. | 11538 11539 11540### OH_Drawing_PenSetColor() 11541 11542``` 11543void OH_Drawing_PenSetColor (OH_Drawing_Pen* , uint32_t color ) 11544``` 11545 11546**Description** 11547 11548Sets the color for a pen. The color is used by the pen to outline a shape. 11549 11550Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11551 11552If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11553 11554**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11555 11556**Since**: 8 11557 11558**Parameters** 11559 11560| Name | Description | 11561| -------------- | ----------------------------------------- | 11562| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11563| color | Color, which is a 32-bit (ARGB) variable. | 11564 11565 11566### OH_Drawing_PenSetFilter() 11567 11568``` 11569void OH_Drawing_PenSetFilter (OH_Drawing_Pen* , OH_Drawing_Filter* ) 11570``` 11571 11572**Description** 11573 11574Sets a filter for a pen. 11575 11576Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11577 11578If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11579 11580**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11581 11582**Since**: 11 11583 11584**Parameters** 11585 11586| Name | Description | 11587| ----------------- | ------------------------------------------------------------ | 11588| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11589| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. If NULL is passed in, the filter will be cleared. | 11590 11591 11592### OH_Drawing_PenSetJoin() 11593 11594``` 11595void OH_Drawing_PenSetJoin (OH_Drawing_Pen* , OH_Drawing_PenLineJoinStyle ) 11596``` 11597 11598**Description** 11599 11600Sets the line join style for a pen. 11601 11602Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11603 11604If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11605 11606If **OH_Drawing_PenLineJoinStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 11607 11608**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11609 11610**Since**: 8 11611 11612**Parameters** 11613 11614| Name | Description | 11615| --------------------------- | ---------------------------------------- | 11616| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11617| OH_Drawing_PenLineJoinStyle | Line join style. | 11618 11619 11620### OH_Drawing_PenSetMiterLimit() 11621 11622``` 11623void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen* , float miter ) 11624``` 11625 11626**Description** 11627 11628Sets the stroke miter limit for a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded. 11629 11630Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11631 11632If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11633 11634**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11635 11636**Since**: 8 11637 11638**Parameters** 11639 11640| Name | Description | 11641| -------------- | ---------------------------------------- | 11642| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11643| miter | Stroke miter limit, which is a variable. | 11644 11645 11646### OH_Drawing_PenSetPathEffect() 11647 11648``` 11649void OH_Drawing_PenSetPathEffect (OH_Drawing_Pen* , OH_Drawing_PathEffect* ) 11650``` 11651 11652**Description** 11653 11654Sets the path effect for a pen. 11655 11656Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11657 11658If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11659 11660**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11661 11662**Since**: 12 11663 11664**Parameters** 11665 11666| Name | Description | 11667| --------------------- | ------------------------------------------------------------ | 11668| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11669| OH_Drawing_PathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. If NULL is passed in, the path effect will be cleared. | 11670 11671 11672### OH_Drawing_PenSetShaderEffect() 11673 11674``` 11675void OH_Drawing_PenSetShaderEffect (OH_Drawing_Pen* , OH_Drawing_ShaderEffect* ) 11676``` 11677 11678**Description** 11679 11680Sets the shader effect for a pen. 11681 11682Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11683 11684If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11685 11686**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11687 11688**Since**: 11 11689 11690**Parameters** 11691 11692| Name | Description | 11693| ----------------------- | ------------------------------------------------------------ | 11694| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. | 11695| OH_Drawing_ShaderEffect | Pointer to an [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object. If NULL is passed in, the shader effect will be cleared. | 11696 11697 11698### OH_Drawing_PenSetWidth() 11699 11700``` 11701void OH_Drawing_PenSetWidth (OH_Drawing_Pen* , float width ) 11702``` 11703 11704**Description** 11705 11706Sets the width for a pen. The value **0** is treated as an unusually thin width. During drawing, the width of 0 is always drawn as 1 pixel wide, regardless of any scaling applied to the canvas. Negative values are also regarded as the value **0** during the drawing process. 11707 11708Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11709 11710If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11711 11712**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11713 11714**Since**: 8 11715 11716**Parameters** 11717 11718| Name | Description | 11719| -------------- | ---------------------------------------- | 11720| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. | 11721| width | Width, which is a variable. | 11722 11723 11724### OH_Drawing_PointCreate() 11725 11726``` 11727OH_Drawing_Point* OH_Drawing_PointCreate (float x, float y ) 11728``` 11729 11730**Description** 11731 11732Creates an **OH_Drawing_Point** object. 11733 11734**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11735 11736**Since**: 11 11737 11738**Parameters** 11739 11740| Name | Description | 11741| ---- | -------------------------- | 11742| x | X coordinate of the point. | 11743| y | Y coordinate of the point. | 11744 11745**Returns** 11746 11747Returns the pointer to the **OH_Drawing_Point** object created. 11748 11749 11750### OH_Drawing_PointDestroy() 11751 11752``` 11753void OH_Drawing_PointDestroy (OH_Drawing_Point* ) 11754``` 11755 11756**Description** 11757 11758Destroys an **OH_Drawing_Point** object and reclaims the memory occupied by the object. 11759 11760**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11761 11762**Since**: 11 11763 11764**Parameters** 11765 11766| Name | Description | 11767| ---------------- | ------------------------------------------ | 11768| OH_Drawing_Point | Pointer to an **OH_Drawing_Point** object. | 11769 11770 11771### OH_Drawing_RectCopy() 11772 11773``` 11774void OH_Drawing_RectCopy (OH_Drawing_Rect* sRect, OH_Drawing_Rect* dRect ) 11775``` 11776 11777**Description** 11778 11779Copies a source rectangle to create a new one. 11780 11781Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11782 11783If either **sRect** or **dRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11784 11785**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11786 11787**Since**: 12 11788 11789**Parameters** 11790 11791| Name | Description | 11792| ----- | ------------------------------------------------------------ | 11793| sRect | Pointer to a source rectangle, which is an **OH_Drawing_Rect** object. | 11794| dRect | Pointer to a destination rectangle, which is an **OH_Drawing_Rect** object. | 11795 11796 11797### OH_Drawing_RectCreate() 11798 11799``` 11800OH_Drawing_Rect* OH_Drawing_RectCreate (float left, float top, float right, float bottom ) 11801``` 11802 11803**Description** 11804 11805Creates an **OH_Drawing_Rect** object, without sorting the coordinates passed in. This means that the coordinates of the upper left corner of the rectangle can be greater than those of the lower right corner. 11806 11807**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11808 11809**Since**: 11 11810 11811**Parameters** 11812 11813| Name | Description | 11814| ------ | -------------------------------------------------------- | 11815| left | X coordinate of the upper left corner of the rectangle. | 11816| top | Y coordinate of the upper left corner of the rectangle. | 11817| right | X coordinate of the lower right corner of the rectangle. | 11818| bottom | Y coordinate of the lower right corner of the rectangle. | 11819 11820**Returns** 11821 11822Returns the pointer to the **OH_Drawing_Rect** object created. 11823 11824 11825### OH_Drawing_RectDestroy() 11826 11827``` 11828void OH_Drawing_RectDestroy (OH_Drawing_Rect* ) 11829``` 11830 11831**Description** 11832 11833Destroys an **OH_Drawing_Rect** object and reclaims the memory occupied by the object. 11834 11835**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11836 11837**Since**: 11 11838 11839**Parameters** 11840 11841| Name | Description | 11842| --------------- | ----------------------------------------- | 11843| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11844 11845 11846### OH_Drawing_RectGetBottom() 11847 11848``` 11849float OH_Drawing_RectGetBottom (OH_Drawing_Rect* ) 11850``` 11851 11852**Description** 11853 11854Obtains the Y coordinate of the lower right corner of a rectangle. 11855 11856Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11857 11858If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11859 11860**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11861 11862**Since**: 12 11863 11864**Parameters** 11865 11866| Name | Description | 11867| --------------- | ----------------------------------------- | 11868| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11869 11870**Returns** 11871 11872Returns the Y coordinate of the lower right corner of the rectangle. 11873 11874 11875### OH_Drawing_RectGetHeight() 11876 11877``` 11878float OH_Drawing_RectGetHeight (OH_Drawing_Rect* ) 11879``` 11880 11881**Description** 11882 11883Obtains the height of a rectangle. The height is calculated by using the Y coordinate of the lower right corner of the rectangle minus the Y coordinate of the upper left corner. 11884 11885Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11886 11887If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11888 11889**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11890 11891**Since**: 12 11892 11893**Parameters** 11894 11895| Name | Description | 11896| --------------- | ----------------------------------------- | 11897| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11898 11899**Returns** 11900 11901Returns the height. 11902 11903 11904### OH_Drawing_RectGetLeft() 11905 11906``` 11907float OH_Drawing_RectGetLeft (OH_Drawing_Rect* ) 11908``` 11909 11910**Description** 11911 11912Obtains the X coordinate of the upper left corner of a rectangle. 11913 11914Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11915 11916If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11917 11918**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11919 11920**Since**: 12 11921 11922**Parameters** 11923 11924| Name | Description | 11925| --------------- | ----------------------------------------- | 11926| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11927 11928**Returns** 11929 11930Returns the X coordinate of the upper left corner of the rectangle. 11931 11932 11933### OH_Drawing_RectGetRight() 11934 11935``` 11936float OH_Drawing_RectGetRight (OH_Drawing_Rect* ) 11937``` 11938 11939**Description** 11940 11941Obtains the X coordinate of the lower right corner of a rectangle. 11942 11943Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11944 11945If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11946 11947**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11948 11949**Since**: 12 11950 11951**Parameters** 11952 11953| Name | Description | 11954| --------------- | ----------------------------------------- | 11955| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11956 11957**Returns** 11958 11959Returns the X coordinate of the lower right corner of the rectangle. 11960 11961 11962### OH_Drawing_RectGetTop() 11963 11964``` 11965float OH_Drawing_RectGetTop (OH_Drawing_Rect* ) 11966``` 11967 11968**Description** 11969 11970Obtains the Y coordinate of the upper left corner of a rectangle. 11971 11972Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 11973 11974If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 11975 11976**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 11977 11978**Since**: 12 11979 11980**Parameters** 11981 11982| Name | Description | 11983| --------------- | ----------------------------------------- | 11984| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 11985 11986**Returns** 11987 11988Returns the Y coordinate of the upper left corner of the rectangle. 11989 11990 11991### OH_Drawing_RectGetWidth() 11992 11993``` 11994float OH_Drawing_RectGetWidth (OH_Drawing_Rect* ) 11995``` 11996 11997**Description** 11998 11999Obtains the width of a rectangle. The width is calculated by using the X coordinate of the lower right corner of the rectangle minus the X coordinate of the upper left corner. 12000 12001Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12002 12003If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12004 12005**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12006 12007**Since**: 12 12008 12009**Parameters** 12010 12011| Name | Description | 12012| --------------- | ----------------------------------------- | 12013| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 12014 12015**Returns** 12016 12017Returns the width. 12018 12019 12020### OH_Drawing_RectIntersect() 12021 12022``` 12023bool OH_Drawing_RectIntersect (OH_Drawing_Rect* rect, const OH_Drawing_Rect* other ) 12024``` 12025 12026**Description** 12027 12028Checks whether two rectangles intersect and if yes, sets **rect** to the area of intersection. 12029 12030Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12031 12032If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12033 12034**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12035 12036**Since**: 12 12037 12038**Parameters** 12039 12040| Name | Description | 12041| ----- | ------------------------------------------------------------ | 12042| rect | Pointer to the first rectangle, which is an **OH_Drawing_Rect** object. | 12043| other | Pointer to the second rectangle, which is an **OH_Drawing_Rect** object. | 12044 12045**Returns** 12046 12047Returns **true** if they intersect (**rect** is set to the intersection area); returns **false** otherwise (**rect** remains unchanged). 12048 12049 12050### OH_Drawing_RectSetBottom() 12051 12052``` 12053void OH_Drawing_RectSetBottom (OH_Drawing_Rect* rect, float bottom ) 12054``` 12055 12056**Description** 12057 12058Sets the vertical coordinate of the lower right corner of a rectangle. 12059 12060Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12061 12062If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12063 12064**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12065 12066**Since**: 12 12067 12068**Parameters** 12069 12070| Name | Description | 12071| ------ | -------------------------------------------------------- | 12072| rect | Pointer to an **OH_Drawing_Rect** object. | 12073| bottom | Y coordinate of the lower right corner of the rectangle. | 12074 12075 12076### OH_Drawing_RectSetLeft() 12077 12078``` 12079void OH_Drawing_RectSetLeft (OH_Drawing_Rect* rect, float left ) 12080``` 12081 12082**Description** 12083 12084Sets the horizontal coordinate of the upper left corner of a rectangle. 12085 12086Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12087 12088If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12089 12090**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12091 12092**Since**: 12 12093 12094**Parameters** 12095 12096| Name | Description | 12097| ---- | ------------------------------------------------------- | 12098| rect | Pointer to an **OH_Drawing_Rect** object. | 12099| left | X coordinate of the upper left corner of the rectangle. | 12100 12101 12102### OH_Drawing_RectSetRight() 12103 12104``` 12105void OH_Drawing_RectSetRight (OH_Drawing_Rect* rect, float right ) 12106``` 12107 12108**Description** 12109 12110Sets the horizontal coordinate of the lower right corner of a rectangle. 12111 12112Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12113 12114If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12115 12116**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12117 12118**Since**: 12 12119 12120**Parameters** 12121 12122| Name | Description | 12123| ----- | -------------------------------------------------------- | 12124| rect | Pointer to an **OH_Drawing_Rect** object. | 12125| right | X coordinate of the lower right corner of the rectangle. | 12126 12127 12128### OH_Drawing_RectSetTop() 12129 12130``` 12131void OH_Drawing_RectSetTop (OH_Drawing_Rect* rect, float top ) 12132``` 12133 12134**Description** 12135 12136Sets the vertical coordinate of the upper left corner of a rectangle. 12137 12138Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12139 12140If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12141 12142**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12143 12144**Since**: 12 12145 12146**Parameters** 12147 12148| Name | Description | 12149| ---- | ------------------------------------------------------- | 12150| rect | Pointer to an **OH_Drawing_Rect** object. | 12151| top | Y coordinate of the upper left corner of the rectangle. | 12152 12153 12154### OH_Drawing_RegionCreate() 12155 12156``` 12157OH_Drawing_Region* OH_Drawing_RegionCreate (void ) 12158``` 12159 12160**Description** 12161 12162Creates an **OH_Drawing_Region** object for more accurate graphical control. 12163 12164**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12165 12166**Since**: 12 12167 12168**Returns** 12169 12170Returns the pointer to the **OH_Drawing_Region** object created. 12171 12172 12173### OH_Drawing_RegionDestroy() 12174 12175``` 12176void OH_Drawing_RegionDestroy (OH_Drawing_Region* ) 12177``` 12178 12179**Description** 12180 12181Destroys an **OH_Drawing_Region** object and reclaims the memory occupied by the object. 12182 12183**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12184 12185**Since**: 12 12186 12187**Parameters** 12188 12189| Name | Description | 12190| ----------------- | ------------------------------------------- | 12191| OH_Drawing_Region | Pointer to an **OH_Drawing_Region** object. | 12192 12193 12194### OH_Drawing_RegionSetRect() 12195 12196``` 12197bool OH_Drawing_RegionSetRect (OH_Drawing_Region* region, const OH_Drawing_Rect* rect ) 12198``` 12199 12200**Description** 12201 12202Sets the boundary for an **OH_Drawing_Region** object. 12203 12204Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12205 12206If either **region** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12207 12208**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12209 12210**Since**: 12 12211 12212**Parameters** 12213 12214| Name | Description | 12215| ------ | ------------------------------------------- | 12216| region | Pointer to an **OH_Drawing_Region** object. | 12217| rect | Pointer to an **OH_Drawing_Rect** object. | 12218 12219**Returns** 12220 12221Returns **true** if the setting is successful; returns **false** otherwise. 12222 12223 12224### OH_Drawing_RegisterFont() 12225 12226``` 12227uint32_t OH_Drawing_RegisterFont (OH_Drawing_FontCollection* , const char* fontFamily, const char* familySrc ) 12228``` 12229 12230**Description** 12231 12232Registers a custom font with the font manager. The supported font file formats are .ttf and .otf. 12233 12234**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12235 12236**Since**: 11 12237 12238**Parameters** 12239 12240| Name | Description | 12241| ------------------------- | --------------------------------------------------- | 12242| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. | 12243| fontFamily | Pointer to the family name of the font to register. | 12244| familySrc | Pointer to the path of the font file. | 12245 12246**Returns** 12247 12248Returns **0** if the font is registered; returns **1** if the file does not exist; returns **2** if opening the file fails; returns **3** if reading the file fails; returns **4** if the file is not found; returns **5** if the file size is not obtained; returns **9** if the file is damaged. 12249 12250 12251### OH_Drawing_RegisterFontBuffer() 12252 12253``` 12254uint32_t OH_Drawing_RegisterFontBuffer (OH_Drawing_FontCollection* , const char* fontFamily, uint8_t* fontBuffer, size_t length ) 12255``` 12256 12257**Description** 12258 12259Registers a font buffer with the font manager. 12260 12261**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12262 12263**Since**: 11 12264 12265**Parameters** 12266 12267| Name | Description | 12268| ------------------------- | --------------------------------------------------- | 12269| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. | 12270| fontFamily | Pointer to the family name of the font to register. | 12271| fontBuffer | Pointer to the buffer of the font file. | 12272| length | Length of the font file. | 12273 12274**Returns** 12275 12276Returns **0** if the font is registered; returns **6** if the buffer size is zero; returns **7** if the font set is empty; returns **9** if the file is damaged. 12277 12278 12279### OH_Drawing_RoundRectCreate() 12280 12281``` 12282OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate (const OH_Drawing_Rect* , float xRad, float yRad ) 12283``` 12284 12285**Description** 12286 12287Creates an **OH_Drawing_RoundRect** object. 12288 12289Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12290 12291If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12292 12293**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12294 12295**Since**: 11 12296 12297**Parameters** 12298 12299| Name | Description | 12300| --------------- | ------------------------------------------- | 12301| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. | 12302| xRad | Radius of the rounded corner on the X axis. | 12303| yRad | Radius of the rounded corner on the Y axis. | 12304 12305**Returns** 12306 12307Returns the pointer to the **OH_Drawing_RoundRect** object created. 12308 12309 12310### OH_Drawing_RoundRectDestroy() 12311 12312``` 12313void OH_Drawing_RoundRectDestroy (OH_Drawing_RoundRect* ) 12314``` 12315 12316**Description** 12317 12318Destroys an **OH_Drawing_RoundRect** object and reclaims the memory occupied by the object. 12319 12320**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12321 12322**Since**: 11 12323 12324**Parameters** 12325 12326| Name | Description | 12327| -------------------- | ---------------------------------------------- | 12328| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object. | 12329 12330 12331### OH_Drawing_RoundRectGetCorner() 12332 12333``` 12334OH_Drawing_Corner_Radii OH_Drawing_RoundRectGetCorner (OH_Drawing_RoundRect* , OH_Drawing_CornerPos pos ) 12335``` 12336 12337**Description** 12338 12339Obtains the radii of the specified rounded corner in a rounded rectangle. 12340 12341Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12342 12343If **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12344 12345**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12346 12347**Since**: 12 12348 12349**Parameters** 12350 12351| Name | Description | 12352| -------------------- | ------------------------------------------------------------ | 12353| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object. | 12354| pos | Position of the rounded corner. For details about the available options, see [OH_Drawing_CornerPos](#oh_drawing_cornerpos). | 12355 12356**Returns** 12357 12358Returns an [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) struct, including the radii on the X axis and Y axis. 12359 12360 12361### OH_Drawing_RoundRectSetCorner() 12362 12363``` 12364void OH_Drawing_RoundRectSetCorner (OH_Drawing_RoundRect* , OH_Drawing_CornerPos pos, OH_Drawing_Corner_Radii ) 12365``` 12366 12367**Description** 12368 12369Sets the radii of the specified rounded corner in a rounded rectangle. 12370 12371Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12372 12373If **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 12374 12375**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12376 12377**Since**: 12 12378 12379**Parameters** 12380 12381| Name | Description | 12382| ----------------------- | ------------------------------------------------------------ | 12383| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object. | 12384| pos | Position of the rounded corner. For details about the available options, see [OH_Drawing_CornerPos](#oh_drawing_cornerpos). | 12385| OH_Drawing_Corner_Radii | [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) struct, including the radii on the X axis and Y axis. | 12386 12387 12388### OH_Drawing_SamplingOptionsCreate() 12389 12390``` 12391OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate (OH_Drawing_FilterMode , OH_Drawing_MipmapMode ) 12392``` 12393 12394**Description** 12395 12396Creates an **OH_Drawing_SamplingOptions** object. 12397 12398Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 12399 12400If **OH_Drawing_MipmapMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 12401 12402**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12403 12404**Since**: 12 12405 12406**Parameters** 12407 12408| Name | Description | 12409| --------------------- | ------------------------------------------------------------ | 12410| OH_Drawing_FilterMode | Filter mode. For details about the available options, see [OH_Drawing_FilterMode](#oh_drawing_filtermode). | 12411| OH_Drawing_MipmapMode | Mipmap mode. For details about the available options, see [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode). | 12412 12413**Returns** 12414 12415Returns the pointer to the [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object created. 12416 12417 12418### OH_Drawing_SamplingOptionsDestroy() 12419 12420``` 12421void OH_Drawing_SamplingOptionsDestroy (OH_Drawing_SamplingOptions* ) 12422``` 12423 12424**Description** 12425 12426Destroys an **OH_Drawing_SamplingOptions** object and reclaims the memory occupied by the object. 12427 12428**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12429 12430**Since**: 12 12431 12432**Parameters** 12433 12434| Name | Description | 12435| -------------------------- | ------------------------------------------------------------ | 12436| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. | 12437 12438 12439### OH_Drawing_SetTextStyleBackgroundBrush() 12440 12441``` 12442void OH_Drawing_SetTextStyleBackgroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush* ) 12443``` 12444 12445**Description** 12446 12447Sets the background brush for a text style. 12448 12449**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12450 12451**Since**: 12 12452 12453**Parameters** 12454 12455| Name | Description | 12456| -------------------- | ------------------------------------------------------------ | 12457| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12458| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). | 12459 12460 12461### OH_Drawing_SetTextStyleBackgroundPen() 12462 12463``` 12464void OH_Drawing_SetTextStyleBackgroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen* ) 12465``` 12466 12467**Description** 12468 12469Sets the background pen for a text style. 12470 12471**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12472 12473**Since**: 12 12474 12475**Parameters** 12476 12477| Name | Description | 12478| -------------------- | ------------------------------------------------------------ | 12479| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12480| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). | 12481 12482 12483### OH_Drawing_SetTextStyleBaseLine() 12484 12485``` 12486void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle* , int ) 12487``` 12488 12489**Description** 12490 12491Sets the baseline for a text style. 12492 12493**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12494 12495**Since**: 8 12496 12497**Parameters** 12498 12499| Name | Description | 12500| -------------------- | ------------------------------------------------------------ | 12501| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12502| int | Text baseline. For details about the available options, see [OH_Drawing_TextBaseline](#oh_drawing_textbaseline). | 12503 12504 12505### OH_Drawing_SetTextStyleColor() 12506 12507``` 12508void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle* , uint32_t ) 12509``` 12510 12511**Description** 12512 12513Sets the color for a text style. 12514 12515**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12516 12517**Since**: 8 12518 12519**Parameters** 12520 12521| Name | Description | 12522| -------------------- | ------------------------------------------------------------ | 12523| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12524| uint32_t | Color. | 12525 12526 12527### OH_Drawing_SetTextStyleDecoration() 12528 12529``` 12530void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle* , int ) 12531``` 12532 12533**Description** 12534 12535Sets the decoration for a text style. 12536 12537**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12538 12539**Since**: 8 12540 12541**Parameters** 12542 12543| Name | Description | 12544| -------------------- | ------------------------------------------------------------ | 12545| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12546| int | Text decoration. For details about the available options, see [OH_Drawing_TextDecoration](#oh_drawing_textdecoration). | 12547 12548 12549### OH_Drawing_SetTextStyleDecorationColor() 12550 12551``` 12552void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle* , uint32_t ) 12553``` 12554 12555**Description** 12556 12557Sets the decoration color for a text style. 12558 12559**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12560 12561**Since**: 8 12562 12563**Parameters** 12564 12565| Name | Description | 12566| -------------------- | ------------------------------------------------------------ | 12567| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12568| uint32_t | Color. | 12569 12570 12571### OH_Drawing_SetTextStyleDecorationStyle() 12572 12573``` 12574void OH_Drawing_SetTextStyleDecorationStyle (OH_Drawing_TextStyle* , int ) 12575``` 12576 12577**Description** 12578 12579Sets the decoration style for a text style. 12580 12581**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12582 12583**Since**: 11 12584 12585**Parameters** 12586 12587| Name | Description | 12588| -------------------- | ------------------------------------------------------------ | 12589| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12590| int | Text decoration style. For details about the available options, see [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle). | 12591 12592 12593### OH_Drawing_SetTextStyleDecorationThicknessScale() 12594 12595``` 12596void OH_Drawing_SetTextStyleDecorationThicknessScale (OH_Drawing_TextStyle* , double ) 12597``` 12598 12599**Description** 12600 12601Sets the thickness scale factor for the decoration style of a text style. 12602 12603**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12604 12605**Since**: 11 12606 12607**Parameters** 12608 12609| Name | Description | 12610| -------------------- | ------------------------------------------------------------ | 12611| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12612| double | Scale factor. | 12613 12614 12615### OH_Drawing_SetTextStyleEllipsis() 12616 12617``` 12618void OH_Drawing_SetTextStyleEllipsis (OH_Drawing_TextStyle* , const char* ) 12619``` 12620 12621**Description** 12622 12623Sets the ellipsis content for a text style. 12624 12625**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12626 12627**Since**: 11 12628 12629**Parameters** 12630 12631| Name | Description | 12632| -------------------- | ------------------------------------------------------------ | 12633| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12634| char\* | Pointer to the ellipsis content. The data type is a pointer pointing to char. | 12635 12636 12637### OH_Drawing_SetTextStyleEllipsisModal() 12638 12639``` 12640void OH_Drawing_SetTextStyleEllipsisModal (OH_Drawing_TextStyle* , int ) 12641``` 12642 12643**Description** 12644 12645Sets the ellipsis style for a text style. 12646 12647**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12648 12649**Since**: 11 12650 12651**Parameters** 12652 12653| Name | Description | 12654| -------------------- | ------------------------------------------------------------ | 12655| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12656| int | Ellipsis style. For details about the available options, see [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal). | 12657 12658 12659### OH_Drawing_SetTextStyleFontFamilies() 12660 12661``` 12662void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle* , int , const char* fontFamilies[] ) 12663``` 12664 12665**Description** 12666 12667Sets the font families for a text style. 12668 12669**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12670 12671**Since**: 8 12672 12673**Parameters** 12674 12675| Name | Description | 12676| -------------------- | ------------------------------------------------------------ | 12677| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12678| int | Number of font families. | 12679| char | Pointer to the font families. | 12680 12681 12682### OH_Drawing_SetTextStyleFontHeight() 12683 12684``` 12685void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle* , double ) 12686``` 12687 12688**Description** 12689 12690Sets the line height based on the multiple of the font size. 12691 12692**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12693 12694**Since**: 8 12695 12696**Parameters** 12697 12698| Name | Description | 12699| -------------------- | ------------------------------------------------------------ | 12700| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12701| double | Multiple of the font size. | 12702 12703 12704### OH_Drawing_SetTextStyleFontSize() 12705 12706``` 12707void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle* , double ) 12708``` 12709 12710**Description** 12711 12712Sets the font size for a text style. 12713 12714**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12715 12716**Since**: 8 12717 12718**Parameters** 12719 12720| Name | Description | 12721| -------------------- | ------------------------------------------------------------ | 12722| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12723| double | Font size. | 12724 12725 12726### OH_Drawing_SetTextStyleFontStyle() 12727 12728``` 12729void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle* , int ) 12730``` 12731 12732**Description** 12733 12734Sets the font style for a text style. 12735 12736**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12737 12738**Since**: 8 12739 12740**Parameters** 12741 12742| Name | Description | 12743| -------------------- | ------------------------------------------------------------ | 12744| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12745| int | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). | 12746 12747 12748### OH_Drawing_SetTextStyleFontStyleStruct() 12749 12750``` 12751void OH_Drawing_SetTextStyleFontStyleStruct (OH_Drawing_TextStyle* drawingTextStyle, OH_Drawing_FontStyleStruct fontStyle ) 12752``` 12753 12754**Description** 12755 12756Sets the font style, including the font weight, width, and slant, for a text style. 12757 12758**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12759 12760**Since**: 12 12761 12762**Parameters** 12763 12764| Name | Description | 12765| ------------------------------------------------------------ | ------------------------------------------------------------ | 12766| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12767| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant. | 12768 12769 12770### OH_Drawing_SetTextStyleFontWeight() 12771 12772``` 12773void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle* , int ) 12774``` 12775 12776**Description** 12777 12778Sets the font weight for a text style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect. 12779 12780**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12781 12782**Since**: 8 12783 12784**Parameters** 12785 12786| Name | Description | 12787| -------------------- | ------------------------------------------------------------ | 12788| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12789| int | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). | 12790 12791 12792### OH_Drawing_SetTextStyleForegroundBrush() 12793 12794``` 12795void OH_Drawing_SetTextStyleForegroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush* ) 12796``` 12797 12798**Description** 12799 12800Sets the foreground brush for a text style. 12801 12802**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12803 12804**Since**: 12 12805 12806**Parameters** 12807 12808| Name | Description | 12809| -------------------- | ------------------------------------------------------------ | 12810| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12811| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). | 12812 12813 12814### OH_Drawing_SetTextStyleForegroundPen() 12815 12816``` 12817void OH_Drawing_SetTextStyleForegroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen* ) 12818``` 12819 12820**Description** 12821 12822Sets the foreground pen for a text style. 12823 12824**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12825 12826**Since**: 12 12827 12828**Parameters** 12829 12830| Name | Description | 12831| -------------------- | ------------------------------------------------------------ | 12832| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12833| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). | 12834 12835 12836### OH_Drawing_SetTextStyleHalfLeading() 12837 12838``` 12839void OH_Drawing_SetTextStyleHalfLeading (OH_Drawing_TextStyle* , bool ) 12840``` 12841 12842**Description** 12843 12844Sets whether to enable half leading for a text style. 12845 12846**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12847 12848**Since**: 11 12849 12850**Parameters** 12851 12852| Name | Description | 12853| -------------------- | ------------------------------------------------------------ | 12854| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12855| bool | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. | 12856 12857 12858### OH_Drawing_SetTextStyleLetterSpacing() 12859 12860``` 12861void OH_Drawing_SetTextStyleLetterSpacing (OH_Drawing_TextStyle* , double ) 12862``` 12863 12864**Description** 12865 12866Sets the letter spacing for a text style. 12867 12868**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12869 12870**Since**: 11 12871 12872**Parameters** 12873 12874| Name | Description | 12875| -------------------- | ------------------------------------------------------------ | 12876| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12877| double | Letter spacing. | 12878 12879 12880### OH_Drawing_SetTextStyleLocale() 12881 12882``` 12883void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle* , const char* ) 12884``` 12885 12886**Description** 12887 12888Sets the locale for a text style. 12889 12890**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12891 12892**Since**: 8 12893 12894**Parameters** 12895 12896| Name | Description | 12897| -------------------- | ------------------------------------------------------------ | 12898| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12899| char | Pointer to the locale. For example, **'en'** indicates English, **'zh-Hans'** indicates Simplified Chinese, and **'zh-Hant'** indicates Traditional Chinese. | 12900 12901 12902### OH_Drawing_SetTextStyleWordSpacing() 12903 12904``` 12905void OH_Drawing_SetTextStyleWordSpacing (OH_Drawing_TextStyle* , double ) 12906``` 12907 12908**Description** 12909 12910Sets the word spacing for a text style. 12911 12912**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12913 12914**Since**: 11 12915 12916**Parameters** 12917 12918| Name | Description | 12919| -------------------- | ------------------------------------------------------------ | 12920| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 12921| double | Letter spacing. | 12922 12923 12924### OH_Drawing_SetTypographyStyleFontStyleStruct() 12925 12926``` 12927void OH_Drawing_SetTypographyStyleFontStyleStruct (OH_Drawing_TypographyStyle* drawingStyle, OH_Drawing_FontStyleStruct fontStyle ) 12928``` 12929 12930**Description** 12931 12932Sets the font style, including the font weight, width, and slant, for a typography style. 12933 12934**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12935 12936**Since**: 12 12937 12938**Parameters** 12939 12940| Name | Description | 12941| ------------------------------------------------------------ | ------------------------------------------------------------ | 12942| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 12943| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant. | 12944 12945 12946### OH_Drawing_SetTypographyStyleTextStrutStyle() 12947 12948``` 12949void OH_Drawing_SetTypographyStyleTextStrutStyle (OH_Drawing_TypographyStyle* , OH_Drawing_StrutStyle* ) 12950``` 12951 12952**Description** 12953 12954Sets the strut style for a typography style. 12955 12956**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12957 12958**Since**: 12 12959 12960**Parameters** 12961 12962| Name | Description | 12963| -------------------------------------------------------- | ------------------------------------------------------------ | 12964| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 12965| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Pointer to an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object, which is obtained by calling [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle). | 12966 12967 12968### OH_Drawing_SetTypographyTextAlign() 12969 12970``` 12971void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle* , int ) 12972``` 12973 12974**Description** 12975 12976Sets the text alignment mode. 12977 12978**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 12979 12980**Since**: 8 12981 12982**Parameters** 12983 12984| Name | Description | 12985| -------------------------- | ------------------------------------------------------------ | 12986| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 12987| int | Text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign). | 12988 12989 12990### OH_Drawing_SetTypographyTextBreakStrategy() 12991 12992``` 12993void OH_Drawing_SetTypographyTextBreakStrategy (OH_Drawing_TypographyStyle* , int ) 12994``` 12995 12996**Description** 12997 12998Sets the text break strategy. 12999 13000**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13001 13002**Since**: 11 13003 13004**Parameters** 13005 13006| Name | Description | 13007| -------------------------- | ------------------------------------------------------------ | 13008| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13009| int | Text break strategy. For details about the available options, see [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy). | 13010 13011 13012### OH_Drawing_SetTypographyTextDirection() 13013 13014``` 13015void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle* , int ) 13016``` 13017 13018**Description** 13019 13020Sets the text direction. 13021 13022**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13023 13024**Since**: 8 13025 13026**Parameters** 13027 13028| Name | Description | 13029| -------------------------- | ------------------------------------------------------------ | 13030| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13031| int | Text direction. For details about the available options, see [OH_Drawing_TextDirection](#oh_drawing_textdirection). | 13032 13033 13034### OH_Drawing_SetTypographyTextEllipsis() 13035 13036``` 13037void OH_Drawing_SetTypographyTextEllipsis (OH_Drawing_TypographyStyle* style, const char* ellipsis ) 13038``` 13039 13040**Description** 13041 13042Sets the text ellipsis content. 13043 13044**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13045 13046**Since**: 12 13047 13048**Parameters** 13049 13050| Name | Description | 13051| -------------------------- | ------------------------------------------------------------ | 13052| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13053| char | Pinter to the ellipsis content. | 13054 13055 13056### OH_Drawing_SetTypographyTextEllipsisModal() 13057 13058``` 13059void OH_Drawing_SetTypographyTextEllipsisModal (OH_Drawing_TypographyStyle* , int ) 13060``` 13061 13062**Description** 13063 13064Sets the text ellipsis style. 13065 13066**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13067 13068**Since**: 11 13069 13070**Parameters** 13071 13072| Name | Description | 13073| -------------------------- | ------------------------------------------------------------ | 13074| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13075| int | Ellipsis style. For details about the available options, see [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal). | 13076 13077 13078### OH_Drawing_SetTypographyTextFontFamily() 13079 13080``` 13081void OH_Drawing_SetTypographyTextFontFamily (OH_Drawing_TypographyStyle* , const char* ) 13082``` 13083 13084**Description** 13085 13086Sets the font family name for text. 13087 13088**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13089 13090**Since**: 12 13091 13092**Parameters** 13093 13094| Name | Description | 13095| -------------------------- | ------------------------------------------------------------ | 13096| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13097| char | Pointer to the name of the font family. | 13098 13099 13100### OH_Drawing_SetTypographyTextFontHeight() 13101 13102``` 13103void OH_Drawing_SetTypographyTextFontHeight (OH_Drawing_TypographyStyle* , double ) 13104``` 13105 13106**Description** 13107 13108Sets the font height for text. 13109 13110**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13111 13112**Since**: 12 13113 13114**Parameters** 13115 13116| Name | Description | 13117| -------------------------- | ------------------------------------------------------------ | 13118| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13119| double | Font height. | 13120 13121 13122### OH_Drawing_SetTypographyTextFontSize() 13123 13124``` 13125void OH_Drawing_SetTypographyTextFontSize (OH_Drawing_TypographyStyle* , double ) 13126``` 13127 13128**Description** 13129 13130Sets the font size for text. 13131 13132**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13133 13134**Since**: 12 13135 13136**Parameters** 13137 13138| Name | Description | 13139| -------------------------- | ------------------------------------------------------------ | 13140| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13141| double | Font size, which must be greater than 0. | 13142 13143 13144### OH_Drawing_SetTypographyTextFontStyle() 13145 13146``` 13147void OH_Drawing_SetTypographyTextFontStyle (OH_Drawing_TypographyStyle* , int ) 13148``` 13149 13150**Description** 13151 13152Sets the font style for text. 13153 13154**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13155 13156**Since**: 12 13157 13158**Parameters** 13159 13160| Name | Description | 13161| -------------------------- | ------------------------------------------------------------ | 13162| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13163| int | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). | 13164 13165 13166### OH_Drawing_SetTypographyTextFontWeight() 13167 13168``` 13169void OH_Drawing_SetTypographyTextFontWeight (OH_Drawing_TypographyStyle* , int ) 13170``` 13171 13172**Description** 13173 13174Sets the font weight for text. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect. 13175 13176**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13177 13178**Since**: 12 13179 13180**Parameters** 13181 13182| Name | Description | 13183| -------------------------- | ------------------------------------------------------------ | 13184| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13185| int | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). | 13186 13187 13188### OH_Drawing_SetTypographyTextHalfLeading() 13189 13190``` 13191void OH_Drawing_SetTypographyTextHalfLeading (OH_Drawing_TypographyStyle* , bool ) 13192``` 13193 13194**Description** 13195 13196Sets whether to enable half leading for text. 13197 13198**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13199 13200**Since**: 12 13201 13202**Parameters** 13203 13204| Name | Description | 13205| -------------------------- | ------------------------------------------------------------ | 13206| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13207| bool | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. | 13208 13209 13210### OH_Drawing_SetTypographyTextLineStyleFontFamilies() 13211 13212``` 13213void OH_Drawing_SetTypographyTextLineStyleFontFamilies (OH_Drawing_TypographyStyle* , int , const char* fontFamilies[] ) 13214``` 13215 13216**Description** 13217 13218Sets the font families for a text line style. 13219 13220**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13221 13222**Since**: 12 13223 13224**Parameters** 13225 13226| Name | Description | 13227| -------------------------- | ------------------------------------------------------------ | 13228| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13229| int | Number of font families. | 13230| char | Pointer to the font families. | 13231 13232 13233### OH_Drawing_SetTypographyTextLineStyleFontHeight() 13234 13235``` 13236void OH_Drawing_SetTypographyTextLineStyleFontHeight (OH_Drawing_TypographyStyle* , double ) 13237``` 13238 13239**Description** 13240 13241Sets the font height for a text line style. 13242 13243**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13244 13245**Since**: 12 13246 13247**Parameters** 13248 13249| Name | Description | 13250| -------------------------- | ------------------------------------------------------------ | 13251| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13252| double | Font height. | 13253 13254 13255### OH_Drawing_SetTypographyTextLineStyleFontSize() 13256 13257``` 13258void OH_Drawing_SetTypographyTextLineStyleFontSize (OH_Drawing_TypographyStyle* , double ) 13259``` 13260 13261**Description** 13262 13263Sets the font size for a text line style. 13264 13265**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13266 13267**Since**: 12 13268 13269**Parameters** 13270 13271| Name | Description | 13272| -------------------------- | ------------------------------------------------------------ | 13273| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13274| double | Font size, which must be greater than 0. | 13275 13276 13277### OH_Drawing_SetTypographyTextLineStyleFontStyle() 13278 13279``` 13280void OH_Drawing_SetTypographyTextLineStyleFontStyle (OH_Drawing_TypographyStyle* , int ) 13281``` 13282 13283**Description** 13284 13285Sets the font style for a text line style. 13286 13287**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13288 13289**Since**: 12 13290 13291**Parameters** 13292 13293| Name | Description | 13294| -------------------------- | ------------------------------------------------------------ | 13295| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13296| int | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). | 13297 13298 13299### OH_Drawing_SetTypographyTextLineStyleFontWeight() 13300 13301``` 13302void OH_Drawing_SetTypographyTextLineStyleFontWeight (OH_Drawing_TypographyStyle* , int ) 13303``` 13304 13305**Description** 13306 13307Sets the font weight for a text line style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect. 13308 13309**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13310 13311**Since**: 12 13312 13313**Parameters** 13314 13315| Name | Description | 13316| -------------------------- | ------------------------------------------------------------ | 13317| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13318| int | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). | 13319 13320 13321### OH_Drawing_SetTypographyTextLineStyleHalfLeading() 13322 13323``` 13324void OH_Drawing_SetTypographyTextLineStyleHalfLeading (OH_Drawing_TypographyStyle* , bool ) 13325``` 13326 13327**Description** 13328 13329Sets whether to enable half leading for a text line style. 13330 13331**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13332 13333**Since**: 12 13334 13335**Parameters** 13336 13337| Name | Description | 13338| -------------------------- | ------------------------------------------------------------ | 13339| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13340| bool | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. | 13341 13342 13343### OH_Drawing_SetTypographyTextLineStyleOnly() 13344 13345``` 13346void OH_Drawing_SetTypographyTextLineStyleOnly (OH_Drawing_TypographyStyle* , bool ) 13347``` 13348 13349**Description** 13350 13351Sets whether to enable the text line style only. 13352 13353**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13354 13355**Since**: 12 13356 13357**Parameters** 13358 13359| Name | Description | 13360| -------------------------- | ------------------------------------------------------------ | 13361| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13362| bool | Whether to enable the text line style only. The value **true** means to enable the text line style only, and **false** means the opposite. | 13363 13364 13365### OH_Drawing_SetTypographyTextLineStyleSpacingScale() 13366 13367``` 13368void OH_Drawing_SetTypographyTextLineStyleSpacingScale (OH_Drawing_TypographyStyle* , double ) 13369``` 13370 13371**Description** 13372 13373Sets the spacing scale factor for a text line style. 13374 13375**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13376 13377**Since**: 12 13378 13379**Parameters** 13380 13381| Name | Description | 13382| -------------------------- | ------------------------------------------------------------ | 13383| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13384| double | Spacing ratio. | 13385 13386 13387### OH_Drawing_SetTypographyTextLocale() 13388 13389``` 13390void OH_Drawing_SetTypographyTextLocale (OH_Drawing_TypographyStyle* style, const char* locale ) 13391``` 13392 13393**Description** 13394 13395Sets the locale for text. 13396 13397**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13398 13399**Since**: 12 13400 13401**Parameters** 13402 13403| Name | Description | 13404| -------------------------- | ------------------------------------------------------------ | 13405| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13406| char | Pointer to the locale. For example, **'en'** indicates English, **'zh-Hans'** indicates Simplified Chinese, and **'zh-Hant'** indicates Traditional Chinese. | 13407 13408 13409### OH_Drawing_SetTypographyTextMaxLines() 13410 13411``` 13412void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle* , int ) 13413``` 13414 13415**Description** 13416 13417Sets the maximum number of lines in the text. 13418 13419**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13420 13421**Since**: 8 13422 13423**Parameters** 13424 13425| Name | Description | 13426| -------------------------- | ------------------------------------------------------------ | 13427| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13428| int | Maximum number of lines. | 13429 13430### OH_Drawing_SetTypographyTextSplitRatio() 13431 13432``` 13433void OH_Drawing_SetTypographyTextSplitRatio (OH_Drawing_TypographyStyle* style, float textSplitRatio ) 13434``` 13435 13436**Description** 13437 13438Sets the text split ratio. 13439 13440**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13441 13442**Since**: 12 13443 13444**Parameters** 13445 13446| Name | Description | 13447| -------------------------- | ------------------------------------------------------------ | 13448| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13449| float | Text split ratio. | 13450 13451 13452### OH_Drawing_SetTypographyTextStyle() 13453 13454``` 13455void OH_Drawing_SetTypographyTextStyle (OH_Drawing_TypographyStyle* , OH_Drawing_TextStyle* ) 13456``` 13457 13458**Description** 13459 13460Sets a text style. 13461 13462**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13463 13464**Since**: 12 13465 13466**Parameters** 13467 13468| Name | Description | 13469| -------------------------- | ------------------------------------------------------------ | 13470| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13471| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 13472 13473 13474### OH_Drawing_SetTypographyTextUseLineStyle() 13475 13476``` 13477void OH_Drawing_SetTypographyTextUseLineStyle (OH_Drawing_TypographyStyle* , bool ) 13478``` 13479 13480**Description** 13481 13482Sets whether to enable the text line style. 13483 13484**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13485 13486**Since**: 12 13487 13488**Parameters** 13489 13490| Name | Description | 13491| -------------------------- | ------------------------------------------------------------ | 13492| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13493| bool | Whether to enable the text line style. The value **true** means to enable the text line style, and **false** means the opposite. | 13494 13495 13496### OH_Drawing_SetTypographyTextWordBreakType() 13497 13498``` 13499void OH_Drawing_SetTypographyTextWordBreakType (OH_Drawing_TypographyStyle* , int ) 13500``` 13501 13502**Description** 13503 13504Sets the word break type. 13505 13506**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13507 13508**Since**: 11 13509 13510**Parameters** 13511 13512| Name | Description | 13513| -------------------------- | ------------------------------------------------------------ | 13514| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 13515| int | Word break type. For details about the available options, see [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype). | 13516 13517 13518### OH_Drawing_ShaderEffectCreateImageShader() 13519 13520``` 13521OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader (OH_Drawing_Image* , OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions* , const OH_Drawing_Matrix* ) 13522``` 13523 13524**Description** 13525 13526Creates an **OH_Drawing_ShaderEffect** object for an image shader. You are advised not to use the API for the canvas of the capture type because it affects the performance. 13527 13528Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13529 13530If either **OH_Drawing_Image** or **OH_Drawing_SamplingOptions** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13531 13532If either **tileX** or **tileY** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13533 13534**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13535 13536**Since**: 12 13537 13538**Parameters** 13539 13540| Name | Description | 13541| -------------------------- | ------------------------------------------------------------ | 13542| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. | 13543| tileX | Tile mode of the shader effect in the horizontal direction. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). | 13544| tileY | Tile mode of the shader effect in the vertical direction. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). | 13545| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. | 13546| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If the pointer array is empty, the identity matrix is passed in. | 13547 13548**Returns** 13549 13550Returns the pointer to the **OH_Drawing_ShaderEffect** object created. 13551 13552 13553### OH_Drawing_ShaderEffectCreateLinearGradient() 13554 13555``` 13556OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradient (const OH_Drawing_Point* startPt, const OH_Drawing_Point* endPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode ) 13557``` 13558 13559**Description** 13560 13561Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points. 13562 13563Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13564 13565If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13566 13567If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13568 13569**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13570 13571**Since**: 11 13572 13573**Parameters** 13574 13575| Name | Description | 13576| ------------------- | ------------------------------------------------------------ | 13577| startPt | Start point. | 13578| endPt | End point. | 13579| colors | Colors to distribute. | 13580| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start point and end point. | 13581| size | Number of colors and positions (if **pos** is not NULL). | 13582| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). | 13583 13584**Returns** 13585 13586Returns the pointer to the **OH_Drawing_ShaderEffect** object created. 13587 13588 13589### OH_Drawing_ShaderEffectCreateRadialGradient() 13590 13591``` 13592OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradient (const OH_Drawing_Point* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode ) 13593``` 13594 13595**Description** 13596 13597Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner. 13598 13599Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13600 13601If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13602 13603If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13604 13605**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13606 13607**Since**: 11 13608 13609**Parameters** 13610 13611| Name | Description | 13612| ------------------- | ------------------------------------------------------------ | 13613| centerPt | Center of the circle. | 13614| radius | Radius of the circle. | 13615| colors | Colors to distribute in the radial direction. | 13616| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed in the radial direction. | 13617| size | Number of colors and positions (if **pos** is not NULL). | 13618| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). | 13619 13620**Returns** 13621 13622Returns the pointer to the **OH_Drawing_ShaderEffect** object created. 13623 13624 13625### OH_Drawing_ShaderEffectCreateSweepGradient() 13626 13627``` 13628OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateSweepGradient (const OH_Drawing_Point* centerPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode ) 13629``` 13630 13631**Description** 13632 13633Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the center. A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°. 13634 13635Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13636 13637If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13638 13639If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13640 13641**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13642 13643**Since**: 11 13644 13645**Parameters** 13646 13647| Name | Description | 13648| ------------------- | ------------------------------------------------------------ | 13649| centerPt | Center of the circle. | 13650| colors | Colors to distribute. | 13651| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start angle (0°) and end angle (360°). | 13652| size | Number of colors and positions (if **pos** is not NULL). | 13653| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). | 13654 13655**Returns** 13656 13657Returns the pointer to the **OH_Drawing_ShaderEffect** object created. 13658 13659 13660### OH_Drawing_ShaderEffectDestroy() 13661 13662``` 13663void OH_Drawing_ShaderEffectDestroy (OH_Drawing_ShaderEffect* ) 13664``` 13665 13666**Description** 13667 13668Destroys an **OH_Drawing_ShaderEffect** object and reclaims the memory occupied by the object. 13669 13670**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13671 13672**Since**: 11 13673 13674**Parameters** 13675 13676| Name | Description | 13677| ----------------------- | ------------------------------------------------- | 13678| OH_Drawing_ShaderEffect | Pointer to an **OH_Drawing_ShaderEffect** object. | 13679 13680 13681### OH_Drawing_SurfaceCreateFromGpuContext() 13682 13683``` 13684OH_Drawing_Surface* OH_Drawing_SurfaceCreateFromGpuContext (OH_Drawing_GpuContext* , bool budgeted, OH_Drawing_Image_Info ) 13685``` 13686 13687**Description** 13688 13689Creates an **OH_Drawing_Surface** object using the GPU context to manage the content drawn on the canvas. 13690 13691Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13692 13693If **OH_Drawing_GpuContext** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13694 13695**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13696 13697**Since**: 12 13698 13699**Parameters** 13700 13701| Name | Description | 13702| --------------------------------------------------------- | ------------------------------------------------------------ | 13703| OH_Drawing_GpuContext | Pointer to an [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object. | 13704| budgeted | Whether memory allocation is included in the cache budget. The value **true** means that memory allocation is included in the cache budget, and **false** means the opposite. | 13705| [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object. | 13706 13707**Returns** 13708 13709Returns the pointer to the [OH_Drawing_Surface](#oh_drawing_surface) object created. 13710 13711 13712### OH_Drawing_SurfaceDestroy() 13713 13714``` 13715void OH_Drawing_SurfaceDestroy (OH_Drawing_Surface* ) 13716``` 13717 13718**Description** 13719 13720Destroys an **OH_Drawing_Surface** object and reclaims the memory occupied. 13721 13722**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13723 13724**Since**: 12 13725 13726**Parameters** 13727 13728| Name | Description | 13729| ------------------ | -------------------------------------------- | 13730| OH_Drawing_Surface | Pointer to an **OH_Drawing_Surface** object. | 13731 13732 13733### OH_Drawing_SurfaceGetCanvas() 13734 13735``` 13736OH_Drawing_Canvas* OH_Drawing_SurfaceGetCanvas (OH_Drawing_Surface* ) 13737``` 13738 13739**Description** 13740 13741Obtains a canvas from an **OH_Drawing_Surface** object. 13742 13743Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13744 13745If **OH_Drawing_Surface** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13746 13747**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13748 13749**Since**: 12 13750 13751**Parameters** 13752 13753| Name | Description | 13754| ------------------ | -------------------------------------------- | 13755| OH_Drawing_Surface | Pointer to an **OH_Drawing_Surface** object. | 13756 13757**Returns** 13758 13759Returns the pointer to the [OH_Drawing_Canvas](#oh_drawing_canvas) object created. The pointer returned does not need to be managed by the caller. 13760 13761 13762### OH_Drawing_TextBlobBuilderAllocRunPos() 13763 13764``` 13765const OH_Drawing_RunBuffer* OH_Drawing_TextBlobBuilderAllocRunPos (OH_Drawing_TextBlobBuilder* , const OH_Drawing_Font* , int32_t count, const OH_Drawing_Rect* ) 13766``` 13767 13768**Description** 13769 13770Allocates a run to store glyphs and positions. The pointer returned does not need to be managed by the caller. It can no longer be used after [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) is called. 13771 13772Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13773 13774If either **OH_Drawing_TextBlobBuilder** or **OH_Drawing_Font** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13775 13776**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13777 13778**Since**: 11 13779 13780**Parameters** 13781 13782| Name | Description | 13783| -------------------------- | ------------------------------------------------------------ | 13784| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object. | 13785| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. | 13786| count | Number of text blobs. | 13787| OH_Drawing_Rect | Rectangle of the text blob. The value NULL means that no rectangle is set. | 13788 13789 13790### OH_Drawing_TextBlobBuilderCreate() 13791 13792``` 13793OH_Drawing_TextBlobBuilder* OH_Drawing_TextBlobBuilderCreate (void ) 13794``` 13795 13796**Description** 13797 13798Creates an **OH_Drawing_TextBlobBuilder** object. 13799 13800**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13801 13802**Since**: 11 13803 13804**Returns** 13805 13806Returns the pointer to the **OH_Drawing_TextBlobBuilder** object created. 13807 13808 13809### OH_Drawing_TextBlobBuilderDestroy() 13810 13811``` 13812void OH_Drawing_TextBlobBuilderDestroy (OH_Drawing_TextBlobBuilder* ) 13813``` 13814 13815**Description** 13816 13817Destroys an **OH_Drawing_TextBlobBuilder** object and reclaims the memory occupied by the object. 13818 13819**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13820 13821**Since**: 11 13822 13823**Parameters** 13824 13825| Name | Description | 13826| -------------------------- | ---------------------------------------------------- | 13827| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object. | 13828 13829 13830### OH_Drawing_TextBlobBuilderMake() 13831 13832``` 13833OH_Drawing_TextBlob* OH_Drawing_TextBlobBuilderMake (OH_Drawing_TextBlobBuilder* ) 13834``` 13835 13836**Description** 13837 13838Makes an **OH_Drawing_TextBlob** object from an **OH_Drawing_TextBlobBuilder**. 13839 13840Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13841 13842If **OH_Drawing_TextBlobBuilder** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13843 13844**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13845 13846**Since**: 11 13847 13848**Parameters** 13849 13850| Name | Description | 13851| -------------------------- | ---------------------------------------------------- | 13852| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object. | 13853 13854**Returns** 13855 13856Returns the pointer to the **OH_Drawing_TextBlob** object created. 13857 13858 13859### OH_Drawing_TextBlobCreateFromPosText() 13860 13861``` 13862OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromPosText (const void * text, size_t byteLength, OH_Drawing_Point2D* , const OH_Drawing_Font* , OH_Drawing_TextEncoding ) 13863``` 13864 13865**Description** 13866 13867Creates an **OH_Drawing_TextBlob** object from the text. The coordinates of each character in the **OH_Drawing_TextBlob** object are determined by the coordinate information in the **OH_Drawing_Point2D** array. 13868 13869Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13870 13871If any of **text**, **OH_Drawing_Point2D**, and **OH_Drawing_Font** is NULL or **byteLength** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13872 13873If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13874 13875**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13876 13877**Since**: 12 13878 13879**Parameters** 13880 13881| Name | Description | 13882| -------------------------------------------------- | ------------------------------------------------------------ | 13883| text | Pointer to the text. | 13884| byteLength | Length of the text, in bytes. | 13885| [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Pointer to the start address of an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) array. The number of entries in the array is the value obtained by calling [OH_Drawing_FontCountText](#oh_drawing_fontcounttext). | 13886| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 13887| OH_Drawing_TextEncoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). | 13888 13889**Returns** 13890 13891Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created. 13892 13893 13894### OH_Drawing_TextBlobCreateFromString() 13895 13896``` 13897OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromString (const char* str, const OH_Drawing_Font* , OH_Drawing_TextEncoding ) 13898``` 13899 13900**Description** 13901 13902Creates an **OH_Drawing_TextBlob** object from a string. 13903 13904Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13905 13906If either **str** or **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13907 13908If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13909 13910**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13911 13912**Since**: 12 13913 13914**Parameters** 13915 13916| Name | Description | 13917| ----------------------- | ------------------------------------------------------------ | 13918| str | Pointer to a string. | 13919| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 13920| OH_Drawing_TextEncoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). Currently, only **TEXT_ENCODING_UTF8** takes effect, and other encoding types are treated as **TEXT_ENCODING_UTF8**. | 13921 13922**Returns** 13923 13924Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created. 13925 13926 13927### OH_Drawing_TextBlobCreateFromText() 13928 13929``` 13930OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText (const void * text, size_t byteLength, const OH_Drawing_Font* , OH_Drawing_TextEncoding ) 13931``` 13932 13933**Description** 13934 13935Creates an **OH_Drawing_TextBlob** object from the text. 13936 13937Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13938 13939If either **text** or **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13940 13941If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. 13942 13943**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13944 13945**Since**: 12 13946 13947**Parameters** 13948 13949| Name | Description | 13950| ----------------------- | ------------------------------------------------------------ | 13951| text | Pointer to the text. | 13952| byteLength | Length of the text, in bytes. | 13953| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. | 13954| OH_Drawing_TextEncoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). | 13955 13956**Returns** 13957 13958Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created. 13959 13960 13961### OH_Drawing_TextBlobDestroy() 13962 13963``` 13964void OH_Drawing_TextBlobDestroy (OH_Drawing_TextBlob* ) 13965``` 13966 13967**Description** 13968 13969Destroys an **OH_Drawing_TextBlob** object and reclaims the memory occupied by the object. 13970 13971**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13972 13973**Since**: 11 13974 13975**Parameters** 13976 13977| Name | Description | 13978| ------------------- | --------------------------------------------- | 13979| OH_Drawing_TextBlob | Pointer to an **OH_Drawing_TextBlob** object. | 13980 13981 13982### OH_Drawing_TextBlobGetBounds() 13983 13984``` 13985void OH_Drawing_TextBlobGetBounds (OH_Drawing_TextBlob* , OH_Drawing_Rect* ) 13986``` 13987 13988**Description** 13989 13990Obtains the bounds of an **OH_Drawing_TextBlob** object. 13991 13992Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 13993 13994If either **OH_Drawing_TextBlob** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 13995 13996**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 13997 13998**Since**: 12 13999 14000**Parameters** 14001 14002| Name | Description | 14003| ------------------- | ------------------------------------------------------------ | 14004| OH_Drawing_TextBlob | Pointer to an [OH_Drawing_TextBlob](#oh_drawing_textblob) object. | 14005| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is obtained by calling [OH_Drawing_RectCreate](#oh_drawing_rectcreate). | 14006 14007 14008### OH_Drawing_TextStyleAddFontFeature() 14009 14010``` 14011void OH_Drawing_TextStyleAddFontFeature (OH_Drawing_TextStyle* , const char* tag, int value ) 14012``` 14013 14014**Description** 14015 14016Adds a font feature for a text style. 14017 14018**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14019 14020**Since**: 12 14021 14022**Parameters** 14023 14024| Name | Description | 14025| -------------------- | ------------------------------------------------------------ | 14026| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14027| char | Pointer to the string identified by the keyword in the font feature key-value pair. | 14028| int | Value of the font feature key-value pair. | 14029 14030 14031### OH_Drawing_TextStyleAddFontVariation() 14032 14033``` 14034void OH_Drawing_TextStyleAddFontVariation (OH_Drawing_TextStyle* , const char* , const float ) 14035``` 14036 14037**Description** 14038 14039Adds a font variation. This function takes effect only when the corresponding font file (.ttf file) supports variable adjustment. Otherwise, calling this function does not take effect. 14040 14041**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14042 14043**Since**: 12 14044 14045**Parameters** 14046 14047| Name | Description | 14048| -------------------- | ------------------------------------------------------------ | 14049| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14050| char\* | Pointer to the key in the font variation key-value pair. Currently, only **'wght'** is supported, indicating the font weight. | 14051| float | Value of the font variation key-value pair. Currently, the value range of **'wght'** for the default font is \[0,900\]. | 14052 14053 14054### OH_Drawing_TextStyleAddShadow() 14055 14056``` 14057void OH_Drawing_TextStyleAddShadow (OH_Drawing_TextStyle* , const OH_Drawing_TextShadow* ) 14058``` 14059 14060**Description** 14061 14062Adds a shadow to a text shadow container. 14063 14064**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14065 14066**Since**: 12 14067 14068**Parameters** 14069 14070| Name | Description | 14071| --------------------- | ------------------------------------------------------------ | 14072| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14073| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). | 14074 14075 14076### OH_Drawing_TextStyleClearFontFeature() 14077 14078``` 14079void OH_Drawing_TextStyleClearFontFeature (OH_Drawing_TextStyle* ) 14080``` 14081 14082**Description** 14083 14084Clears all the contents in a font feature map container. 14085 14086**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14087 14088**Since**: 12 14089 14090**Parameters** 14091 14092| Name | Description | 14093| -------------------- | ------------------------------------------------------------ | 14094| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14095 14096 14097### OH_Drawing_TextStyleClearShadows() 14098 14099``` 14100void OH_Drawing_TextStyleClearShadows (OH_Drawing_TextStyle* ) 14101``` 14102 14103**Description** 14104 14105Clears all shadows in a text shadow container. 14106 14107**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14108 14109**Since**: 12 14110 14111**Parameters** 14112 14113| Name | Description | 14114| -------------------- | ------------------------------------------------------------ | 14115| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14116 14117 14118### OH_Drawing_TextStyleDestroyFontFamilies() 14119 14120``` 14121void OH_Drawing_TextStyleDestroyFontFamilies (char** fontFamilies, size_t num ) 14122``` 14123 14124**Description** 14125 14126Reclaims the memory occupied by the font families. 14127 14128**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14129 14130**Since**: 12 14131 14132**Parameters** 14133 14134| Name | Description | 14135| -------- | ------------------------------------ | 14136| char\*\* | Double pointer to the font families. | 14137| size_t | Number of font families. | 14138 14139 14140### OH_Drawing_TextStyleDestroyFontFeatures() 14141 14142``` 14143void OH_Drawing_TextStyleDestroyFontFeatures (OH_Drawing_FontFeature* , size_t fontFeatureSize ) 14144``` 14145 14146**Description** 14147 14148Reclaims the memory occupied by the struct array that holds all the font features. 14149 14150**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14151 14152**Since**: 12 14153 14154**Parameters** 14155 14156| Name | Description | 14157| ---------------------------------------------------------- | ------------------------------------------------------------ | 14158| [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) | Pointer to the struct array that holds all the font features. The pointer is obtained by calling [OH_Drawing_TextStyleGetFontFeatures](#oh_drawing_textstylegetfontfeatures). | 14159| fontFeatureSize | Size of the struct array that holds all the font features. | 14160 14161 14162### OH_Drawing_TextStyleGetBackgroundBrush() 14163 14164``` 14165void OH_Drawing_TextStyleGetBackgroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush* ) 14166``` 14167 14168**Description** 14169 14170Obtains the background brush of a text style. 14171 14172**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14173 14174**Since**: 12 14175 14176**Parameters** 14177 14178| Name | Description | 14179| -------------------- | ------------------------------------------------------------ | 14180| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14181| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). | 14182 14183 14184### OH_Drawing_TextStyleGetBackgroundPen() 14185 14186``` 14187void OH_Drawing_TextStyleGetBackgroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen* ) 14188``` 14189 14190**Description** 14191 14192Obtains the background pen of a text style. 14193 14194**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14195 14196**Since**: 12 14197 14198**Parameters** 14199 14200| Name | Description | 14201| -------------------- | ------------------------------------------------------------ | 14202| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14203| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). | 14204 14205 14206### OH_Drawing_TextStyleGetBaseline() 14207 14208``` 14209OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline (OH_Drawing_TextStyle* ) 14210``` 14211 14212**Description** 14213 14214Obtains the baseline of a text style. 14215 14216**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14217 14218**Since**: 12 14219 14220**Parameters** 14221 14222| Name | Description | 14223| -------------------- | ------------------------------------------------------------ | 14224| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14225 14226**Returns** 14227 14228Returns the text baseline. For details about the available options, see [OH_Drawing_TextBaseline](#oh_drawing_textbaseline). 14229 14230 14231### OH_Drawing_TextStyleGetBaselineShift() 14232 14233``` 14234double OH_Drawing_TextStyleGetBaselineShift (OH_Drawing_TextStyle* ) 14235``` 14236 14237**Description** 14238 14239Obtains the baseline drift of a text style. 14240 14241**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14242 14243**Since**: 12 14244 14245**Parameters** 14246 14247| Name | Description | 14248| -------------------- | ------------------------------------------------------------ | 14249| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14250 14251**Returns** 14252 14253Returns the baseline drift. 14254 14255 14256### OH_Drawing_TextStyleGetColor() 14257 14258``` 14259uint32_t OH_Drawing_TextStyleGetColor (OH_Drawing_TextStyle* ) 14260``` 14261 14262**Description** 14263 14264Obtains the color of a text style. 14265 14266**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14267 14268**Since**: 12 14269 14270**Parameters** 14271 14272| Name | Description | 14273| -------------------- | ------------------------------------------------------------ | 14274| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14275 14276**Returns** 14277 14278Returns the text color. 14279 14280 14281### OH_Drawing_TextStyleGetDecorationStyle() 14282 14283``` 14284OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle (OH_Drawing_TextStyle* ) 14285``` 14286 14287**Description** 14288 14289Obtains the decoration style of a text style. 14290 14291**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14292 14293**Since**: 12 14294 14295**Parameters** 14296 14297| Name | Description | 14298| -------------------- | ------------------------------------------------------------ | 14299| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14300 14301**Returns** 14302 14303Returns the text decoration style. For details about the available options, see [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle). 14304 14305 14306### OH_Drawing_TextStyleGetFontFamilies() 14307 14308``` 14309char** OH_Drawing_TextStyleGetFontFamilies (OH_Drawing_TextStyle* , size_t* num ) 14310``` 14311 14312**Description** 14313 14314Obtains the font families of a text style. 14315 14316**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14317 14318**Since**: 12 14319 14320**Parameters** 14321 14322| Name | Description | 14323| -------------------- | ------------------------------------------------------------ | 14324| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14325| size_t | Pointer to the number of font families. | 14326 14327**Returns** 14328 14329Returns the font families. 14330 14331 14332### OH_Drawing_TextStyleGetFontFeatures() 14333 14334``` 14335OH_Drawing_FontFeature* OH_Drawing_TextStyleGetFontFeatures (OH_Drawing_TextStyle* ) 14336``` 14337 14338**Description** 14339 14340Obtains all the contents in a font feature map container. 14341 14342**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14343 14344**Since**: 12 14345 14346**Parameters** 14347 14348| Name | Description | 14349| -------------------- | ------------------------------------------------------------ | 14350| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14351 14352**Returns** 14353 14354Returns the pointer to the [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) struct, which stores all the contents obtained. 14355 14356 14357### OH_Drawing_TextStyleGetFontFeatureSize() 14358 14359``` 14360size_t OH_Drawing_TextStyleGetFontFeatureSize (OH_Drawing_TextStyle* ) 14361``` 14362 14363**Description** 14364 14365Obtains the size of a font feature map container. 14366 14367**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14368 14369**Since**: 12 14370 14371**Parameters** 14372 14373| Name | Description | 14374| -------------------- | ------------------------------------------------------------ | 14375| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14376 14377**Returns** 14378 14379Returns the size. 14380 14381 14382### OH_Drawing_TextStyleGetFontHeight() 14383 14384``` 14385double OH_Drawing_TextStyleGetFontHeight (OH_Drawing_TextStyle* ) 14386``` 14387 14388**Description** 14389 14390Obtains the font height of a text style. 14391 14392**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14393 14394**Since**: 12 14395 14396**Parameters** 14397 14398| Name | Description | 14399| -------------------- | ------------------------------------------------------------ | 14400| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14401 14402**Returns** 14403 14404Returns the font height. 14405 14406 14407### OH_Drawing_TextStyleGetFontMetrics() 14408 14409``` 14410bool OH_Drawing_TextStyleGetFontMetrics (OH_Drawing_Typography* , OH_Drawing_TextStyle* , OH_Drawing_Font_Metrics* ) 14411``` 14412 14413**Description** 14414 14415Obtains the font metrics of a text style. 14416 14417**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14418 14419**Since**: 12 14420 14421**Parameters** 14422 14423| Name | Description | 14424| ----------------------- | ------------------------------------------------------------ | 14425| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 14426| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14427| OH_Drawing_Font_Metrics | Pointer to an [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) object, which is obtained by calling [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md). | 14428 14429**Returns** 14430 14431Returns **true** if the font metrics are obtained; returns **false** otherwise. 14432 14433 14434### OH_Drawing_TextStyleGetFontSize() 14435 14436``` 14437double OH_Drawing_TextStyleGetFontSize (OH_Drawing_TextStyle* ) 14438``` 14439 14440**Description** 14441 14442Obtains the font size of a text style. 14443 14444**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14445 14446**Since**: 12 14447 14448**Parameters** 14449 14450| Name | Description | 14451| -------------------- | ------------------------------------------------------------ | 14452| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14453 14454**Returns** 14455 14456Returns the font size. 14457 14458 14459### OH_Drawing_TextStyleGetFontStyle() 14460 14461``` 14462OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle (OH_Drawing_TextStyle* ) 14463``` 14464 14465**Description** 14466 14467Obtains the font style of a text style. 14468 14469**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14470 14471**Since**: 12 14472 14473**Parameters** 14474 14475| Name | Description | 14476| -------------------- | ------------------------------------------------------------ | 14477| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14478 14479**Returns** 14480 14481Returns the font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). 14482 14483 14484### OH_Drawing_TextStyleGetFontStyleStruct() 14485 14486``` 14487OH_Drawing_FontStyleStruct OH_Drawing_TextStyleGetFontStyleStruct (OH_Drawing_TextStyle* drawingTextStyle) 14488``` 14489 14490**Description** 14491 14492Obtains the font style, including the font weight, width, and slant, of a text style. 14493 14494**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14495 14496**Since**: 12 14497 14498**Parameters** 14499 14500| Name | Description | 14501| -------------------- | ------------------------------------------------------------ | 14502| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14503 14504**Returns** 14505 14506Returns the font style, including the font weight, width, and slant. 14507 14508 14509### OH_Drawing_TextStyleGetFontWeight() 14510 14511``` 14512OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight (OH_Drawing_TextStyle* ) 14513``` 14514 14515**Description** 14516 14517Obtains the font weight of a text style. 14518 14519**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14520 14521**Since**: 12 14522 14523**Parameters** 14524 14525| Name | Description | 14526| -------------------- | ------------------------------------------------------------ | 14527| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14528 14529**Returns** 14530 14531Returns the font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). 14532 14533 14534### OH_Drawing_TextStyleGetForegroundBrush() 14535 14536``` 14537void OH_Drawing_TextStyleGetForegroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush* ) 14538``` 14539 14540**Description** 14541 14542Obtains the foreground brush of a text style. 14543 14544**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14545 14546**Since**: 12 14547 14548**Parameters** 14549 14550| Name | Description | 14551| -------------------- | ------------------------------------------------------------ | 14552| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14553| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). | 14554 14555 14556### OH_Drawing_TextStyleGetForegroundPen() 14557 14558``` 14559void OH_Drawing_TextStyleGetForegroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen* ) 14560``` 14561 14562**Description** 14563 14564Obtains the foreground pen of a text style. 14565 14566**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14567 14568**Since**: 12 14569 14570**Parameters** 14571 14572| Name | Description | 14573| -------------------- | ------------------------------------------------------------ | 14574| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14575| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). | 14576 14577 14578### OH_Drawing_TextStyleGetHalfLeading() 14579 14580``` 14581bool OH_Drawing_TextStyleGetHalfLeading (OH_Drawing_TextStyle* ) 14582``` 14583 14584**Description** 14585 14586Checks whether half leading is enabled for a text style. 14587 14588**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14589 14590**Since**: 12 14591 14592**Parameters** 14593 14594| Name | Description | 14595| -------------------- | ------------------------------------------------------------ | 14596| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14597 14598**Returns** 14599 14600Returns **true** if half leading is enabled; returns **false** otherwise. 14601 14602 14603### OH_Drawing_TextStyleGetLetterSpacing() 14604 14605``` 14606double OH_Drawing_TextStyleGetLetterSpacing (OH_Drawing_TextStyle* ) 14607``` 14608 14609**Description** 14610 14611Obtains the letter spacing of a text style. 14612 14613**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14614 14615**Since**: 12 14616 14617**Parameters** 14618 14619| Name | Description | 14620| -------------------- | ------------------------------------------------------------ | 14621| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14622 14623**Returns** 14624 14625Returns the letter spacing. 14626 14627 14628### OH_Drawing_TextStyleGetLocale() 14629 14630``` 14631const char* OH_Drawing_TextStyleGetLocale (OH_Drawing_TextStyle* ) 14632``` 14633 14634**Description** 14635 14636Obtains the locale of a text style. 14637 14638**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14639 14640**Since**: 12 14641 14642**Parameters** 14643 14644| Name | Description | 14645| -------------------- | ------------------------------------------------------------ | 14646| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14647 14648**Returns** 14649 14650Returns the pointer to the locale, in the format of language-country. For example, zh-CN indicates Chinese (China), and en-US indicates English (United States). For details, see BCP 47. 14651 14652 14653### OH_Drawing_TextStyleGetShadowCount() 14654 14655``` 14656int OH_Drawing_TextStyleGetShadowCount (OH_Drawing_TextStyle* ) 14657``` 14658 14659**Description** 14660 14661Obtains the size of a text shadow container. 14662 14663**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14664 14665**Since**: 12 14666 14667**Parameters** 14668 14669| Name | Description | 14670| -------------------- | ------------------------------------------------------------ | 14671| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14672 14673**Returns** 14674 14675Returns the size. 14676 14677 14678### OH_Drawing_TextStyleGetShadows() 14679 14680``` 14681OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows (OH_Drawing_TextStyle* ) 14682``` 14683 14684**Description** 14685 14686Obtains a text shadow container. 14687 14688**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14689 14690**Since**: 12 14691 14692**Parameters** 14693 14694| Name | Description | 14695| -------------------- | ------------------------------------------------------------ | 14696| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14697 14698**Returns** 14699 14700Returns the pointer to the [OH_Drawing_TextShadow](#oh_drawing_textshadow) object. 14701 14702 14703### OH_Drawing_TextStyleGetShadowWithIndex() 14704 14705``` 14706OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex (OH_Drawing_TextStyle* , int ) 14707``` 14708 14709**Description** 14710 14711Obtains a shadow with a given index in a text shadow container. 14712 14713**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14714 14715**Since**: 12 14716 14717**Parameters** 14718 14719| Name | Description | 14720| -------------------- | ------------------------------------------------------------ | 14721| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14722| int | Index. | 14723 14724**Returns** 14725 14726Returns the pointer to the [OH_Drawing_TextShadow](#oh_drawing_textshadow) object. 14727 14728 14729### OH_Drawing_TextStyleGetWordSpacing() 14730 14731``` 14732double OH_Drawing_TextStyleGetWordSpacing (OH_Drawing_TextStyle* ) 14733``` 14734 14735**Description** 14736 14737Obtains the word spacing of a text style. 14738 14739**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14740 14741**Since**: 12 14742 14743**Parameters** 14744 14745| Name | Description | 14746| -------------------- | ------------------------------------------------------------ | 14747| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14748 14749**Returns** 14750 14751Returns the word spacing. 14752 14753 14754### OH_Drawing_TextStyleIsAttributeMatched() 14755 14756``` 14757bool OH_Drawing_TextStyleIsAttributeMatched (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle, OH_Drawing_TextStyleType textStyleType ) 14758``` 14759 14760**Description** 14761 14762Checks whether two text styles have the same text style type. 14763 14764**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14765 14766**Since**: 12 14767 14768**Parameters** 14769 14770| Name | Description | 14771| ------------- | ------------------------------------------------------------ | 14772| style | Pointer to the first text style. | 14773| comparedStyle | Pointer to the second text style. | 14774| textStyleType | Text style type. For details about the available options, see [OH_Drawing_TextStyleType](#oh_drawing_textstyletype). | 14775 14776**Returns** 14777 14778Returns **true** if the two are the same; returns **false** otherwise. 14779 14780 14781### OH_Drawing_TextStyleIsEqual() 14782 14783``` 14784bool OH_Drawing_TextStyleIsEqual (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle ) 14785``` 14786 14787**Description** 14788 14789Checks whether two text styles are equal. 14790 14791**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14792 14793**Since**: 12 14794 14795**Parameters** 14796 14797| Name | Description | 14798| ------------- | --------------------------------- | 14799| style | Pointer to the first text style. | 14800| comparedStyle | Pointer to the second text style. | 14801 14802**Returns** 14803 14804Returns **true** if the two are equal; returns **false** otherwise. 14805 14806 14807### OH_Drawing_TextStyleIsEqualByFont() 14808 14809``` 14810bool OH_Drawing_TextStyleIsEqualByFont (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle ) 14811``` 14812 14813**Description** 14814 14815Checks whether the font style properties of two text styles are equal. 14816 14817**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14818 14819**Since**: 12 14820 14821**Parameters** 14822 14823| Name | Description | 14824| ------------- | --------------------------------- | 14825| style | Pointer to the first text style. | 14826| comparedStyle | Pointer to the second text style. | 14827 14828**Returns** 14829 14830Returns **true** if the two are equal; returns **false** otherwise. 14831 14832 14833### OH_Drawing_TextStyleIsPlaceholder() 14834 14835``` 14836bool OH_Drawing_TextStyleIsPlaceholder (OH_Drawing_TextStyle* style) 14837``` 14838 14839**Description** 14840 14841Checks whether a placeholder is set for a text style. 14842 14843**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14844 14845**Since**: 12 14846 14847**Parameters** 14848 14849| Name | Description | 14850| -------------------- | ------------------------------------------------------------ | 14851| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14852 14853**Returns** 14854 14855Returns **true** if a placeholder is set; returns **false** otherwise. 14856 14857 14858### OH_Drawing_TextStyleSetBackgroundRect() 14859 14860``` 14861void OH_Drawing_TextStyleSetBackgroundRect (OH_Drawing_TextStyle* , const OH_Drawing_RectStyle_Info* , int styleId ) 14862``` 14863 14864**Description** 14865 14866Sets a background rectangle and style ID for a text style. The style ID is valid only when the background box is a rounded rectangle. 14867 14868**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14869 14870**Since**: 12 14871 14872**Parameters** 14873 14874| Name | Description | 14875| ------------------------------------------------------------ | ------------------------------------------------------------ | 14876| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14877| [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) | Pointer to an [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) object. | 14878| int | Style ID. The style ID is valid only when the background box is a rounded rectangle. Text processing is divided into multiple segments. Each segment has its own text style. **id** indicates the sequence number of the background box in which the segment is drawn. If the ID of each segment in a row is 0, all segments are drawn in the same background box. If the IDs in a row are 0 and 1, the segment whose ID is 0 is drawn in a background box, the segment whose ID is 1 is drawn in another background box. Other cases can be deduced in the same way. | 14879 14880 14881### OH_Drawing_TextStyleSetBaselineShift() 14882 14883``` 14884void OH_Drawing_TextStyleSetBaselineShift (OH_Drawing_TextStyle* , double lineShift ) 14885``` 14886 14887**Description** 14888 14889Sets a baseline drift for a text style. 14890 14891**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14892 14893**Since**: 12 14894 14895**Parameters** 14896 14897| Name | Description | 14898| -------------------- | ------------------------------------------------------------ | 14899| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14900| double | Baseline drift of the text style. | 14901 14902 14903### OH_Drawing_TextStyleSetPlaceholder() 14904 14905``` 14906void OH_Drawing_TextStyleSetPlaceholder (OH_Drawing_TextStyle* style) 14907``` 14908 14909**Description** 14910 14911Sets a placeholder for a text style. 14912 14913**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14914 14915**Since**: 12 14916 14917**Parameters** 14918 14919| Name | Description | 14920| -------------------- | ------------------------------------------------------------ | 14921| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 14922 14923 14924### OH_Drawing_TypefaceCreateDefault() 14925 14926``` 14927OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault (void ) 14928``` 14929 14930**Description** 14931 14932Creates a default **OH_Drawing_Typeface** object. 14933 14934**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14935 14936**Since**: 11 14937 14938**Returns** 14939 14940Returns the pointer to the **OH_Drawing_Typeface** object created. 14941 14942 14943### OH_Drawing_TypefaceCreateFromFile() 14944 14945``` 14946OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFile (const char* path, int index ) 14947``` 14948 14949**Description** 14950 14951Creates an **OH_Drawing_Typeface** object through a file. 14952 14953Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 14954 14955If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 14956 14957**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14958 14959**Since**: 12 14960 14961**Parameters** 14962 14963| Name | Description | 14964| ----- | ------------------------- | 14965| path | Pointer to the file path. | 14966| index | File index. | 14967 14968**Returns** 14969 14970Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. 14971 14972 14973### OH_Drawing_TypefaceCreateFromStream() 14974 14975``` 14976OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream (OH_Drawing_MemoryStream* , int32_t index ) 14977``` 14978 14979**Description** 14980 14981Creates an **OH_Drawing_Typeface** object through a memory stream. If the memory stream is an invalid font file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot release it. 14982 14983Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). 14984 14985If **OH_Drawing_MemoryStream** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. 14986 14987**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 14988 14989**Since**: 12 14990 14991**Parameters** 14992 14993| Name | Description | 14994| ----------------------- | ------------------------------------------------------------ | 14995| OH_Drawing_MemoryStream | Pointer to an [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object. | 14996| index | Index of the memory stream. | 14997 14998**Returns** 14999 15000Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. 15001 15002 15003### OH_Drawing_TypefaceDestroy() 15004 15005``` 15006void OH_Drawing_TypefaceDestroy (OH_Drawing_Typeface* ) 15007``` 15008 15009**Description** 15010 15011Destroys an **OH_Drawing_Typeface** object and reclaims the memory occupied by the object. 15012 15013**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15014 15015**Since**: 11 15016 15017**Parameters** 15018 15019| Name | Description | 15020| ------------------- | --------------------------------------------- | 15021| OH_Drawing_Typeface | Pointer to an **OH_Drawing_Typeface** object. | 15022 15023 15024### OH_Drawing_TypographyDestroyEllipsis() 15025 15026``` 15027void OH_Drawing_TypographyDestroyEllipsis (char* ellipsis) 15028``` 15029 15030**Description** 15031 15032Reclaims the memory occupied by the text ellipsis names. 15033 15034**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15035 15036**Since**: 12 15037 15038**Parameters** 15039 15040| Name | Description | 15041| -------- | ----------------------------------- | 15042| ellipsis | Pointer to the text ellipsis names. | 15043 15044 15045### OH_Drawing_TypographyDestroyLineFontMetrics() 15046 15047``` 15048void OH_Drawing_TypographyDestroyLineFontMetrics (OH_Drawing_Font_Metrics* ) 15049``` 15050 15051**Description** 15052 15053Reclaims the memory occupied by the struct array that holds all the font metrics of a given line. 15054 15055**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15056 15057**Since**: 12 15058 15059**Parameters** 15060 15061| Name | Description | 15062| ------------------------------------------------------------ | ------------------------------------------------- | 15063| [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) | Pointer to the first address of the struct array. | 15064 15065 15066### OH_Drawing_TypographyDidExceedMaxLines() 15067 15068``` 15069bool OH_Drawing_TypographyDidExceedMaxLines (OH_Drawing_Typography* ) 15070``` 15071 15072**Description** 15073 15074Checks whether the maximum number of lines is exceeded. 15075 15076**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15077 15078**Since**: 11 15079 15080**Parameters** 15081 15082| Name | Description | 15083| --------------------- | ------------------------------------------------------------ | 15084| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15085 15086**Returns** 15087 15088Returns **true** if the maximum number of lines is exceeded; returns **false** otherwise. 15089 15090 15091### OH_Drawing_TypographyGetAlphabeticBaseline() 15092 15093``` 15094double OH_Drawing_TypographyGetAlphabeticBaseline (OH_Drawing_Typography* ) 15095``` 15096 15097**Description** 15098 15099Obtains the alphabetic baseline. 15100 15101**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15102 15103**Since**: 9 15104 15105**Parameters** 15106 15107| Name | Description | 15108| --------------------- | ------------------------------------------------------------ | 15109| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15110 15111**Returns** 15112 15113Returns the alphabetic baseline. 15114 15115 15116### OH_Drawing_TypographyGetEffectiveAlignment() 15117 15118``` 15119int OH_Drawing_TypographyGetEffectiveAlignment (OH_Drawing_TypographyStyle* style) 15120``` 15121 15122**Description** 15123 15124Obtains the text alignment mode. 15125 15126**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15127 15128**Since**: 12 15129 15130**Parameters** 15131 15132| Name | Description | 15133| -------------------------- | ------------------------------------------------------------ | 15134| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15135 15136**Returns** 15137 15138Returns the text alignment mode. 15139 15140 15141### OH_Drawing_TypographyGetGlyphPositionAtCoordinate() 15142 15143``` 15144OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinate (OH_Drawing_Typography* , double , double ) 15145``` 15146 15147**Description** 15148 15149Obtains the position and affinity of the glyph at the given coordinates. 15150 15151**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15152 15153**Since**: 11 15154 15155**Parameters** 15156 15157| Name | Description | 15158| --------------------- | ------------------------------------------------------------ | 15159| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15160| double | X coordinate. | 15161| double | Y coordinate. | 15162 15163**Returns** 15164 15165Returns the [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) struct that holds the position and affinity of the glyph. 15166 15167 15168### OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster() 15169 15170``` 15171OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster (OH_Drawing_Typography* , double , double ) 15172``` 15173 15174**Description** 15175 15176Obtains the position and affinity of the glyph cluster to which the glyph at the given coordinates belongs. The glyph cluster is a container that holds one or more glyphs. 15177 15178**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15179 15180**Since**: 11 15181 15182**Parameters** 15183 15184| Name | Description | 15185| --------------------- | ------------------------------------------------------------ | 15186| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15187| double | X coordinate. | 15188| double | Y coordinate. | 15189 15190**Returns** 15191 15192Returns the [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) struct that holds the position and affinity of the glyph cluster. 15193 15194 15195### OH_Drawing_TypographyGetHeight() 15196 15197``` 15198double OH_Drawing_TypographyGetHeight (OH_Drawing_Typography* ) 15199``` 15200 15201**Description** 15202 15203Obtains the height. 15204 15205**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15206 15207**Since**: 9 15208 15209**Parameters** 15210 15211| Name | Description | 15212| --------------------- | ------------------------------------------------------------ | 15213| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15214 15215**Returns** 15216 15217Returns the height. 15218 15219 15220### OH_Drawing_TypographyGetIdeographicBaseline() 15221 15222``` 15223double OH_Drawing_TypographyGetIdeographicBaseline (OH_Drawing_Typography* ) 15224``` 15225 15226**Description** 15227 15228Obtains the ideographic baseline. 15229 15230**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15231 15232**Since**: 9 15233 15234**Parameters** 15235 15236| Name | Description | 15237| --------------------- | ------------------------------------------------------------ | 15238| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15239 15240**Returns** 15241 15242Returns the ideographic baseline. 15243 15244 15245### OH_Drawing_TypographyGetIndentsWithIndex() 15246 15247``` 15248float OH_Drawing_TypographyGetIndentsWithIndex (OH_Drawing_Typography* , int ) 15249``` 15250 15251**Description** 15252 15253Obtains indents with a given index. 15254 15255**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15256 15257**Since**: 12 15258 15259**Parameters** 15260 15261| Name | Description | 15262| --------------------- | ------------------------------------------------------------ | 15263| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15264| int | Index. | 15265 15266**Returns** 15267 15268Returns the indents. 15269 15270 15271### OH_Drawing_TypographyGetLineCount() 15272 15273``` 15274size_t OH_Drawing_TypographyGetLineCount (OH_Drawing_Typography* ) 15275``` 15276 15277**Description** 15278 15279Obtains the number of lines. 15280 15281**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15282 15283**Since**: 11 15284 15285**Parameters** 15286 15287| Name | Description | 15288| --------------------- | ------------------------------------------------------------ | 15289| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15290 15291**Returns** 15292 15293Returns the number of lines. 15294 15295 15296### OH_Drawing_TypographyGetLineFontMetrics() 15297 15298``` 15299OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics (OH_Drawing_Typography* , size_t lineNumber, size_t* fontMetricsSize ) 15300``` 15301 15302**Description** 15303 15304Obtains all font metrics from a given line. 15305 15306**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15307 15308**Since**: 12 15309 15310**Parameters** 15311 15312| Name | Description | 15313| --------------------- | ------------------------------------------------------------ | 15314| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15315| lineNumber | Line number, which is an integer. The minimum value is 1, and the maximum value depends on the number of lines parsed by the font engine after text input. If a value greater than the maximum number is passed in, an error value is returned and an error message is printed. | 15316| fontMetricsSize | Pointer to the size of the struct. | 15317 15318**Returns** 15319 15320Returns all the font metrics. 15321 15322 15323### OH_Drawing_TypographyGetLineHeight() 15324 15325``` 15326double OH_Drawing_TypographyGetLineHeight (OH_Drawing_Typography* , int ) 15327``` 15328 15329**Description** 15330 15331Obtains the line height. 15332 15333**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15334 15335**Since**: 11 15336 15337**Parameters** 15338 15339| Name | Description | 15340| --------------------- | ------------------------------------------------------------ | 15341| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15342| int | Target line. | 15343 15344**Returns** 15345 15346Returns the height. 15347 15348 15349### OH_Drawing_TypographyGetLineInfo() 15350 15351``` 15352bool OH_Drawing_TypographyGetLineInfo (OH_Drawing_Typography* , int , bool , bool , OH_Drawing_LineMetrics* ) 15353``` 15354 15355**Description** 15356 15357Obtains the metrics of a given line or the metrics of the first character in a given line. 15358 15359**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15360 15361**Since**: 12 15362 15363**Parameters** 15364 15365| Name | Description | 15366| ---------------------- | ------------------------------------------------------------ | 15367| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15368| int | Row No. | 15369| bool | Whether to obtain the metrics of the entire line. The value **true** means to obtain the metrics of the entire line, and **false** means to obtain the metrics of the first character in the line. | 15370| bool | Whether whitespace characters are included in the text width. The value **true** means that whitespace characters are not included, **false** means the opposite. | 15371| OH_Drawing_LineMetrics | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). | 15372 15373**Returns** 15374 15375Returns **true** if the metrics of the given line or the metrics of the first character in the given line is obtained; returns **false** otherwise. 15376 15377 15378### OH_Drawing_TypographyGetLineMetrics() 15379 15380``` 15381OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics (OH_Drawing_Typography* ) 15382``` 15383 15384**Description** 15385 15386Obtains the line metrics. 15387 15388**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15389 15390**Since**: 12 15391 15392**Parameters** 15393 15394| Name | Description | 15395| --------------------- | ------------------------------------------------------------ | 15396| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15397 15398**Returns** 15399 15400Returns the pointer to the [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object. 15401 15402 15403### OH_Drawing_TypographyGetLineMetricsAt() 15404 15405``` 15406bool OH_Drawing_TypographyGetLineMetricsAt (OH_Drawing_Typography* , int , OH_Drawing_LineMetrics* ) 15407``` 15408 15409**Description** 15410 15411Obtains the metrics of a given line. 15412 15413**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15414 15415**Since**: 12 15416 15417**Parameters** 15418 15419| Name | Description | 15420| ---------------------------------------------------------- | ------------------------------------------------------------ | 15421| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15422| int | Line No. | 15423| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). | 15424 15425**Returns** 15426 15427Returns **true** if the metrics of the given line are obtained; returns **false** otherwise. 15428 15429 15430### OH_Drawing_TypographyGetLineTextRange() 15431 15432``` 15433OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange (OH_Drawing_Typography* , int , bool ) 15434``` 15435 15436**Description** 15437 15438Obtains the line bounds. 15439 15440**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15441 15442**Since**: 12 15443 15444**Parameters** 15445 15446| Name | Description | 15447| --------------------- | ------------------------------------------------------------ | 15448| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15449| int | Row index. | 15450| bool | Whether the returned bounds contain spaces. The value **true** means that the bounds contain spaces, and **false** means the opposite. | 15451 15452**Returns** 15453 15454Returns the pointer to the [OH_Drawing_Range](#oh_drawing_range) object. 15455 15456 15457### OH_Drawing_TypographyGetLineWidth() 15458 15459``` 15460double OH_Drawing_TypographyGetLineWidth (OH_Drawing_Typography* , int ) 15461``` 15462 15463**Description** 15464 15465Obtains the line width. 15466 15467**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15468 15469**Since**: 11 15470 15471**Parameters** 15472 15473| Name | Description | 15474| --------------------- | ------------------------------------------------------------ | 15475| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15476| int | Target line. | 15477 15478**Returns** 15479 15480Returns the width. 15481 15482 15483### OH_Drawing_TypographyGetLongestLine() 15484 15485``` 15486double OH_Drawing_TypographyGetLongestLine (OH_Drawing_Typography* ) 15487``` 15488 15489**Description** 15490 15491Obtains the width of the longest line. You are advised to round up the return value in actual use. When the text content is empty, the minimum float value, that is, -340282346638528859811704183484516925440.000000, is returned. 15492 15493**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15494 15495**Since**: 9 15496 15497**Parameters** 15498 15499| Name | Description | 15500| --------------------- | ------------------------------------------------------------ | 15501| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15502 15503**Returns** 15504 15505Returns the width of the longest line. 15506 15507 15508### OH_Drawing_TypographyGetMaxIntrinsicWidth() 15509 15510``` 15511double OH_Drawing_TypographyGetMaxIntrinsicWidth (OH_Drawing_Typography* ) 15512``` 15513 15514**Description** 15515 15516Obtains the maximum intrinsic width. 15517 15518**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15519 15520**Since**: 9 15521 15522**Parameters** 15523 15524| Name | Description | 15525| --------------------- | ------------------------------------------------------------ | 15526| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15527 15528**Returns** 15529 15530Returns the maximum intrinsic width. 15531 15532 15533### OH_Drawing_TypographyGetMaxWidth() 15534 15535``` 15536double OH_Drawing_TypographyGetMaxWidth (OH_Drawing_Typography* ) 15537``` 15538 15539**Description** 15540 15541Obtains the maximum width. 15542 15543**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15544 15545**Since**: 9 15546 15547**Parameters** 15548 15549| Name | Description | 15550| --------------------- | ------------------------------------------------------------ | 15551| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15552 15553**Returns** 15554 15555Returns the maximum width. 15556 15557 15558### OH_Drawing_TypographyGetMinIntrinsicWidth() 15559 15560``` 15561double OH_Drawing_TypographyGetMinIntrinsicWidth (OH_Drawing_Typography* ) 15562``` 15563 15564**Description** 15565 15566Obtains the minimum intrinsic width. 15567 15568**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15569 15570**Since**: 9 15571 15572**Parameters** 15573 15574| Name | Description | 15575| --------------------- | ------------------------------------------------------------ | 15576| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15577 15578**Returns** 15579 15580Returns the minimum intrinsic width. 15581 15582 15583### OH_Drawing_TypographyGetRectsForPlaceholders() 15584 15585``` 15586OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForPlaceholders (OH_Drawing_Typography* ) 15587``` 15588 15589**Description** 15590 15591Obtains text boxes for placeholders. 15592 15593**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15594 15595**Since**: 11 15596 15597**Parameters** 15598 15599| Name | Description | 15600| --------------------- | ------------------------------------------------------------ | 15601| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15602 15603**Returns** 15604 15605Returns the [OH_Drawing_TextBox](#oh_drawing_textbox) struct that holds the text boxes. 15606 15607### OH_Drawing_TypographyGetRectsForRange() 15608 15609``` 15610OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForRange (OH_Drawing_Typography* , size_t , size_t , OH_Drawing_RectHeightStyle , OH_Drawing_RectWidthStyle ) 15611``` 15612 15613**Description** 15614 15615Obtains text boxes in a given range. 15616 15617**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15618 15619**Since**: 11 15620 15621**Parameters** 15622 15623| Name | Description | 15624| -------------------------- | ------------------------------------------------------------ | 15625| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15626| size_t | Start position. | 15627| size_t | End position. | 15628| OH_Drawing_RectHeightStyle | Height style. For details about the available options, see [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle). | 15629| OH_Drawing_RectWidthStyle | Width style. For details about the available options, see [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle). | 15630 15631**Returns** 15632 15633Returns the [OH_Drawing_TextBox](#oh_drawing_textbox) struct that holds the text boxes. 15634 15635 15636### OH_Drawing_TypographyGetTextAlign() 15637 15638``` 15639OH_Drawing_TextAlign OH_Drawing_TypographyGetTextAlign (OH_Drawing_TypographyStyle* ) 15640``` 15641 15642**Description** 15643 15644Obtains the text alignment mode. 15645 15646**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15647 15648**Since**: 12 15649 15650**Parameters** 15651 15652| Name | Description | 15653| -------------------------- | ------------------------------------------------------------ | 15654| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15655 15656**Returns** 15657 15658Returns the text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign). 15659 15660 15661### OH_Drawing_TypographyGetTextDirection() 15662 15663``` 15664OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection (OH_Drawing_TypographyStyle* ) 15665``` 15666 15667**Description** 15668 15669Obtains the text direction. 15670 15671**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15672 15673**Since**: 12 15674 15675**Parameters** 15676 15677| Name | Description | 15678| -------------------------- | ------------------------------------------------------------ | 15679| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15680 15681**Returns** 15682 15683Returns the text direction. For details about the available options, see [OH_Drawing_TextDirection](#oh_drawing_textdirection). 15684 15685 15686### OH_Drawing_TypographyGetTextEllipsis() 15687 15688``` 15689char* OH_Drawing_TypographyGetTextEllipsis (OH_Drawing_TypographyStyle* ) 15690``` 15691 15692**Description** 15693 15694Obtains the text ellipsis content. 15695 15696**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15697 15698**Since**: 12 15699 15700**Parameters** 15701 15702| Name | Description | 15703| -------------------------- | ------------------------------------------------------------ | 15704| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15705 15706**Returns** 15707 15708Returns the pointer to the text ellipsis content obtained. 15709 15710 15711### OH_Drawing_TypographyGetTextMaxLines() 15712 15713``` 15714size_t OH_Drawing_TypographyGetTextMaxLines (OH_Drawing_TypographyStyle* ) 15715``` 15716 15717**Description** 15718 15719Obtains the maximum number of lines. 15720 15721**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15722 15723**Since**: 12 15724 15725**Parameters** 15726 15727| Name | Description | 15728| -------------------------- | ------------------------------------------------------------ | 15729| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15730 15731**Returns** 15732 15733Returns the maximum number of lines. 15734 15735 15736### OH_Drawing_TypographyGetTextStyle() 15737 15738``` 15739OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle (OH_Drawing_TypographyStyle* style) 15740``` 15741 15742**Description** 15743 15744Obtains the text style of a typography style. 15745 15746**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15747 15748**Since**: 12 15749 15750**Parameters** 15751 15752| Name | Description | 15753| -------------------------- | ------------------------------------------------------------ | 15754| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15755 15756**Returns** 15757 15758Returns the pointer to the [OH_Drawing_TextStyle](#oh_drawing_textstyle) object. 15759 15760 15761### OH_Drawing_TypographyGetUnresolvedGlyphsCount() 15762 15763``` 15764int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount (OH_Drawing_Typography* ) 15765``` 15766 15767**Description** 15768 15769Obtains the number of unresolved glyphs in a typography object. 15770 15771**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15772 15773**Since**: 12 15774 15775**Parameters** 15776 15777| Name | Description | 15778| --------------------- | ------------------------------------------------------------ | 15779| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15780 15781**Returns** 15782 15783Returns the number of unresolved glyphs. 15784 15785 15786### OH_Drawing_TypographyGetWordBoundary() 15787 15788``` 15789OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary (OH_Drawing_Typography* , size_t ) 15790``` 15791 15792**Description** 15793 15794Obtains the word boundary. 15795 15796**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15797 15798**Since**: 11 15799 15800**Parameters** 15801 15802| Name | Description | 15803| --------------------- | ------------------------------------------------------------ | 15804| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15805| size_t | Index of the word. | 15806 15807**Returns** 15808 15809Returns the [OH_Drawing_Range](#oh_drawing_range) struct that holds the word boundary. 15810 15811 15812### OH_Drawing_TypographyHandlerAddPlaceholder() 15813 15814``` 15815void OH_Drawing_TypographyHandlerAddPlaceholder (OH_Drawing_TypographyCreate* , OH_Drawing_PlaceholderSpan* ) 15816``` 15817 15818**Description** 15819 15820Adds a placeholder. 15821 15822**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15823 15824**Since**: 11 15825 15826**Parameters** 15827 15828| Name | Description | 15829| ------------------------------------------------------------ | ------------------------------------------------------------ | 15830| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 15831| [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) | Pointer to an **OH_Drawing_PlaceholderSpan** object. | 15832 15833 15834### OH_Drawing_TypographyHandlerAddSymbol() 15835 15836``` 15837void OH_Drawing_TypographyHandlerAddSymbol (OH_Drawing_TypographyCreate* , uint32_t symbol ) 15838``` 15839 15840**Description** 15841 15842Adds the symbol to use in the typography creation process. 15843 15844**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15845 15846**Since**: 12 15847 15848**Parameters** 15849 15850| Name | Description | 15851| --------------------------- | ------------------------------------------------------------ | 15852| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 15853| uint32_t | Symbol. For details about the supported symbols, see the value in the JSON file. [https://gitee.com/openharmony/global_system_resources/blob/master/systemres/main/resources/base/element/symbol.json](https://gitee.com/openharmony/global_system_resources/blob/master/systemres/main/resources/base/element/symbol.json) | 15854 15855 15856### OH_Drawing_TypographyHandlerAddText() 15857 15858``` 15859void OH_Drawing_TypographyHandlerAddText (OH_Drawing_TypographyCreate* , const char* ) 15860``` 15861 15862**Description** 15863 15864Adds text. 15865 15866**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15867 15868**Since**: 8 15869 15870**Parameters** 15871 15872| Name | Description | 15873| --------------------------- | ------------------------------------------------------------ | 15874| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 15875| char | Pointer to the text content. | 15876 15877 15878### OH_Drawing_TypographyHandlerPopTextStyle() 15879 15880``` 15881void OH_Drawing_TypographyHandlerPopTextStyle (OH_Drawing_TypographyCreate* ) 15882``` 15883 15884**Description** 15885 15886Removes the topmost text style in the stack, leaving the remaining styles in effect. 15887 15888**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15889 15890**Since**: 8 15891 15892**Parameters** 15893 15894| Name | Description | 15895| --------------------------- | ------------------------------------------------------------ | 15896| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 15897 15898 15899### OH_Drawing_TypographyHandlerPushTextStyle() 15900 15901``` 15902void OH_Drawing_TypographyHandlerPushTextStyle (OH_Drawing_TypographyCreate* , OH_Drawing_TextStyle* ) 15903``` 15904 15905**Description** 15906 15907Pushes the text style. 15908 15909**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15910 15911**Since**: 8 15912 15913**Parameters** 15914 15915| Name | Description | 15916| --------------------------- | ------------------------------------------------------------ | 15917| OH_Drawing_TypographyCreate | Pointer to an **OH_Drawing_TypographyCreate** object. The pointer is obtained by [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). | 15918| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). | 15919 15920 15921### OH_Drawing_TypographyIsEllipsized() 15922 15923``` 15924bool OH_Drawing_TypographyIsEllipsized (OH_Drawing_TypographyStyle* style) 15925``` 15926 15927**Description** 15928 15929Checks whether the text has an ellipsis. 15930 15931**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15932 15933**Since**: 12 15934 15935**Parameters** 15936 15937| Name | Description | 15938| -------------------------- | ------------------------------------------------------------ | 15939| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15940 15941**Returns** 15942 15943Returns **true** if the text has an ellipsis; returns **false** otherwise. 15944 15945 15946### OH_Drawing_TypographyIsLineUnlimited() 15947 15948``` 15949bool OH_Drawing_TypographyIsLineUnlimited (OH_Drawing_TypographyStyle* style) 15950``` 15951 15952**Description** 15953 15954Checks whether the maximum number of lines is limited for text. 15955 15956**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15957 15958**Since**: 12 15959 15960**Parameters** 15961 15962| Name | Description | 15963| -------------------------- | ------------------------------------------------------------ | 15964| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 15965 15966**Returns** 15967 15968Returns **true** if that the maximum number of lines is limited; returns **false** otherwise. 15969 15970 15971### OH_Drawing_TypographyLayout() 15972 15973``` 15974void OH_Drawing_TypographyLayout (OH_Drawing_Typography* , double ) 15975``` 15976 15977**Description** 15978 15979Lays out the typography. 15980 15981**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 15982 15983**Since**: 8 15984 15985**Parameters** 15986 15987| Name | Description | 15988| --------------------- | ------------------------------------------------------------ | 15989| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 15990| double | Maximum text width. | 15991 15992 15993### OH_Drawing_TypographyMarkDirty() 15994 15995``` 15996void OH_Drawing_TypographyMarkDirty (OH_Drawing_Typography* ) 15997``` 15998 15999**Description** 16000 16001Marks a typography object as dirty data. This function is used to initialize the typography state. 16002 16003**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16004 16005**Since**: 12 16006 16007**Parameters** 16008 16009| Name | Description | 16010| --------------------- | ------------------------------------------------------------ | 16011| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 16012 16013 16014### OH_Drawing_TypographyPaint() 16015 16016``` 16017void OH_Drawing_TypographyPaint (OH_Drawing_Typography* , OH_Drawing_Canvas* , double , double ) 16018``` 16019 16020**Description** 16021 16022Paints text on the canvas. 16023 16024**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16025 16026**Since**: 8 16027 16028**Parameters** 16029 16030| Name | Description | 16031| --------------------- | ------------------------------------------------------------ | 16032| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 16033| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object, which is obtained by calling **OH_Drawing_CanvasCreate()**. | 16034| double | X coordinate. | 16035| double | Y coordinate. | 16036 16037 16038### OH_Drawing_TypographySetIndents() 16039 16040``` 16041void OH_Drawing_TypographySetIndents (OH_Drawing_Typography* , int , const float indents[] ) 16042``` 16043 16044**Description** 16045 16046Sets indents for typography. If this function is not called, texts will have no indentation applied. 16047 16048**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16049 16050**Since**: 12 16051 16052**Parameters** 16053 16054| Name | Description | 16055| --------------------- | ------------------------------------------------------------ | 16056| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 16057| int | Number of indents. The value must be less than or equal to the length of the indents array to avoid display exceptions caused by access to the out-of-bounds array. | 16058| float | Pointer to a floating-point array, in which each element indicates an indentation width, in px. Before using [OH_Drawing_Typography](#oh_drawing_typography), you must declare and initialize the floating-point array. | 16059 16060 16061### OH_Drawing_TypographyStyleDestroyStrutStyle() 16062 16063``` 16064void OH_Drawing_TypographyStyleDestroyStrutStyle (OH_Drawing_StrutStyle* ) 16065``` 16066 16067**Description** 16068 16069Reclaims the memory occupied by a strut style. 16070 16071**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16072 16073**Since**: 12 16074 16075**Parameters** 16076 16077| Name | Description | 16078| -------------------------------------------------------- | ------------------------------------------------------------ | 16079| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Pointer to an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object, which is obtained by calling [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle). | 16080 16081 16082### OH_Drawing_TypographyStyleEquals() 16083 16084``` 16085bool OH_Drawing_TypographyStyleEquals (OH_Drawing_TypographyStyle* from, OH_Drawing_TypographyStyle* to ) 16086``` 16087 16088**Description** 16089 16090Checks whether two typography styles are the same. 16091 16092**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16093 16094**Since**: 12 16095 16096**Parameters** 16097 16098| Name | Description | 16099| ---- | --------------------------------------- | 16100| from | Pointer to the first typography style. | 16101| to | Pointer to the second typography style. | 16102 16103**Returns** 16104 16105Returns **true** if the two are the same; returns **false** otherwise. 16106 16107 16108### OH_Drawing_TypographyStyleGetEffectiveAlignment() 16109 16110``` 16111OH_Drawing_TextAlign OH_Drawing_TypographyStyleGetEffectiveAlignment (OH_Drawing_TypographyStyle* style) 16112``` 16113 16114**Description** 16115 16116Obtains the text alignment mode. 16117 16118**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16119 16120**Since**: 12 16121 16122**Parameters** 16123 16124| Name | Description | 16125| -------------------------- | ------------------------------------------------------------ | 16126| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16127 16128**Returns** 16129 16130Returns the text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign). 16131 16132 16133### OH_Drawing_TypographyStyleGetFontStyleStruct() 16134 16135``` 16136OH_Drawing_FontStyleStruct OH_Drawing_TypographyStyleGetFontStyleStruct (OH_Drawing_TypographyStyle* drawingStyle) 16137``` 16138 16139**Description** 16140 16141Obtains the font style, including the font weight, width, and slant, of a typography style. 16142 16143**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16144 16145**Since**: 12 16146 16147**Parameters** 16148 16149| Name | Description | 16150| -------------------------- | ------------------------------------------------------------ | 16151| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16152 16153**Returns** 16154 16155Returns the font style, including the font weight, width, and slant. 16156 16157 16158### OH_Drawing_TypographyStyleGetStrutStyle() 16159 16160``` 16161OH_Drawing_StrutStyle* OH_Drawing_TypographyStyleGetStrutStyle (OH_Drawing_TypographyStyle* ) 16162``` 16163 16164**Description** 16165 16166Obtains the strut style of a typography style. 16167 16168**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16169 16170**Since**: 12 16171 16172**Parameters** 16173 16174| Name | Description | 16175| -------------------------- | ------------------------------------------------------------ | 16176| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16177 16178**Returns** 16179 16180Returns the pointer to the strut style, which is an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object. 16181 16182 16183### OH_Drawing_TypographyStyleIsHintEnabled() 16184 16185``` 16186bool OH_Drawing_TypographyStyleIsHintEnabled (OH_Drawing_TypographyStyle* style) 16187``` 16188 16189**Description** 16190 16191Checks whether font hinting is enabled for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it. 16192 16193**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16194 16195**Since**: 12 16196 16197**Parameters** 16198 16199| Name | Description | 16200| -------------------------- | ------------------------------------------------------------ | 16201| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16202 16203**Returns** 16204 16205Returns **true** if font hinting is enabled; returns **false** otherwise. 16206 16207 16208### OH_Drawing_TypographyStyleSetHintsEnabled() 16209 16210``` 16211void OH_Drawing_TypographyStyleSetHintsEnabled (OH_Drawing_TypographyStyle* style, bool hintsEnabled ) 16212``` 16213 16214**Description** 16215 16216Sets whether to enable font hinting for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it. 16217 16218**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16219 16220**Since**: 12 16221 16222**Parameters** 16223 16224| Name | Description | 16225| -------------------------- | ------------------------------------------------------------ | 16226| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16227| hintsEnabled | Whether to enable font hinting. The value **true** means to enable font hinting, and **false** means the opposite. | 16228 16229 16230### OH_Drawing_TypographyStyleStrutStyleEquals() 16231 16232``` 16233bool OH_Drawing_TypographyStyleStrutStyleEquals (OH_Drawing_StrutStyle* from, OH_Drawing_StrutStyle* to ) 16234``` 16235 16236**Description** 16237 16238Checks whether two strut styles are equal. 16239 16240**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16241 16242**Since**: 12 16243 16244**Parameters** 16245 16246| Name | Description | 16247| ---- | ---------------------------------- | 16248| from | Pointer to the first strut style. | 16249| to | Pointer to the second strut style. | 16250 16251**Returns** 16252 16253Returns **true** if the two strut styles are the same; returns **false** otherwise. 16254 16255### OH_Drawing_TypographyTextGetHeightBehavior() 16256 16257``` 16258OH_Drawing_TextHeightBehavior OH_Drawing_TypographyTextGetHeightBehavior (OH_Drawing_TypographyStyle* ) 16259``` 16260 16261**Description** 16262 16263Obtains the text height modifier pattern. 16264 16265**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16266 16267**Since**: 12 16268 16269**Parameters** 16270 16271| Name | Description | 16272| -------------------------- | ------------------------------------------------------------ | 16273| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16274 16275**Returns** 16276 16277Returns the text height modifier pattern. For details about the available options, see [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior). 16278 16279 16280### OH_Drawing_TypographyTextGetLineStyle() 16281 16282``` 16283bool OH_Drawing_TypographyTextGetLineStyle (OH_Drawing_TypographyStyle* ) 16284``` 16285 16286**Description** 16287 16288Checks whether the text line style is enabled for a typography style. 16289 16290**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16291 16292**Since**: 12 16293 16294**Parameters** 16295 16296| Name | Description | 16297| -------------------------- | ------------------------------------------------------------ | 16298| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16299 16300**Returns** 16301 16302Returns **true** if the text line style is enabled; returns **false** otherwise. 16303 16304 16305### OH_Drawing_TypographyTextlineGetStyleOnly() 16306 16307``` 16308bool OH_Drawing_TypographyTextlineGetStyleOnly (OH_Drawing_TypographyStyle* ) 16309``` 16310 16311**Description** 16312 16313Checks whether only the text line style is enabled for a typography style. 16314 16315**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16316 16317**Since**: 12 16318 16319**Parameters** 16320 16321| Name | Description | 16322| -------------------------- | ------------------------------------------------------------ | 16323| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16324 16325**Returns** 16326 16327Returns **true** if only the text line style is enabled; returns **false** otherwise. 16328 16329 16330### OH_Drawing_TypographyTextlineStyleDestroyFontFamilies() 16331 16332``` 16333void OH_Drawing_TypographyTextlineStyleDestroyFontFamilies (char** fontFamilies, size_t fontFamiliesNum ) 16334``` 16335 16336**Description** 16337 16338Reclaims the memory occupied by the font families. 16339 16340**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16341 16342**Since**: 12 16343 16344**Parameters** 16345 16346| Name | Description | 16347| --------------- | ------------------------------------ | 16348| fontFamilies | Double pointer to the font families. | 16349| fontFamiliesNum | Number of font families. | 16350 16351 16352### OH_Drawing_TypographyTextlineStyleGetFontFamilies() 16353 16354``` 16355char** OH_Drawing_TypographyTextlineStyleGetFontFamilies (OH_Drawing_TypographyStyle* ) 16356``` 16357 16358**Description** 16359 16360Obtains the font families of a text line style. 16361 16362**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16363 16364**Since**: 12 16365 16366**Parameters** 16367 16368| Name | Description | 16369| -------------------------- | ------------------------------------------------------------ | 16370| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16371 16372**Returns** 16373 16374Returns the font families. 16375 16376 16377### OH_Drawing_TypographyTextlineStyleGetFontSize() 16378 16379``` 16380double OH_Drawing_TypographyTextlineStyleGetFontSize (OH_Drawing_TypographyStyle* ) 16381``` 16382 16383**Description** 16384 16385Obtains the font size of a text line style. 16386 16387**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16388 16389**Since**: 12 16390 16391**Parameters** 16392 16393| Name | Description | 16394| -------------------------- | ------------------------------------------------------------ | 16395| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16396 16397**Returns** 16398 16399Returns the font size. 16400 16401 16402### OH_Drawing_TypographyTextlineStyleGetFontStyle() 16403 16404``` 16405OH_Drawing_FontStyle OH_Drawing_TypographyTextlineStyleGetFontStyle (OH_Drawing_TypographyStyle* ) 16406``` 16407 16408**Description** 16409 16410Obtains the font style of a text line style. 16411 16412**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16413 16414**Since**: 12 16415 16416**Parameters** 16417 16418| Name | Description | 16419| -------------------------- | ------------------------------------------------------------ | 16420| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16421 16422**Returns** 16423 16424Returns the font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). 16425 16426 16427### OH_Drawing_TypographyTextlineStyleGetFontWeight() 16428 16429``` 16430OH_Drawing_FontWeight OH_Drawing_TypographyTextlineStyleGetFontWeight (OH_Drawing_TypographyStyle* ) 16431``` 16432 16433**Description** 16434 16435Obtains the font weight of a text line style. 16436 16437**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16438 16439**Since**: 12 16440 16441**Parameters** 16442 16443| Name | Description | 16444| -------------------------- | ------------------------------------------------------------ | 16445| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16446 16447**Returns** 16448 16449Returns the font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). 16450 16451 16452### OH_Drawing_TypographyTextlineStyleGetHalfLeading() 16453 16454``` 16455bool OH_Drawing_TypographyTextlineStyleGetHalfLeading (OH_Drawing_TypographyStyle* ) 16456``` 16457 16458**Description** 16459 16460Checks whether half leading is enabled for a text line style. 16461 16462**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16463 16464**Since**: 12 16465 16466**Parameters** 16467 16468| Name | Description | 16469| -------------------------- | ------------------------------------------------------------ | 16470| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16471 16472**Returns** 16473 16474Returns **true** if half leading is enabled; returns **false** otherwise. 16475 16476 16477### OH_Drawing_TypographyTextlineStyleGetHeightOnly() 16478 16479``` 16480bool OH_Drawing_TypographyTextlineStyleGetHeightOnly (OH_Drawing_TypographyStyle* ) 16481``` 16482 16483**Description** 16484 16485Checks whether only the font height is used for a text line style. 16486 16487**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16488 16489**Since**: 12 16490 16491**Parameters** 16492 16493| Name | Description | 16494| -------------------------- | ------------------------------------------------------------ | 16495| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16496 16497**Returns** 16498 16499Returns **true** if only the font height is used; returns false otherwise. 16500 16501 16502### OH_Drawing_TypographyTextlineStyleGetHeightScale() 16503 16504``` 16505double OH_Drawing_TypographyTextlineStyleGetHeightScale (OH_Drawing_TypographyStyle* ) 16506``` 16507 16508**Description** 16509 16510Obtains the height scale factor of a text line style. 16511 16512**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16513 16514**Since**: 12 16515 16516**Parameters** 16517 16518| Name | Description | 16519| -------------------------- | ------------------------------------------------------------ | 16520| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16521 16522**Returns** 16523 16524Returns the font height scale factor. 16525 16526 16527### OH_Drawing_TypographyTextlineStyleGetSpacingScale() 16528 16529``` 16530double OH_Drawing_TypographyTextlineStyleGetSpacingScale (OH_Drawing_TypographyStyle* ) 16531``` 16532 16533**Description** 16534 16535Obtains the spacing scale factor of a text line style. 16536 16537**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16538 16539**Since**: 12 16540 16541**Parameters** 16542 16543| Name | Description | 16544| -------------------------- | ------------------------------------------------------------ | 16545| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16546 16547**Returns** 16548 16549Returns the spacing scale factor. 16550 16551 16552### OH_Drawing_TypographyTextSetHeightBehavior() 16553 16554``` 16555void OH_Drawing_TypographyTextSetHeightBehavior (OH_Drawing_TypographyStyle* , OH_Drawing_TextHeightBehavior heightMode ) 16556``` 16557 16558**Description** 16559 16560Sets a text height modifier pattern. 16561 16562**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16563 16564**Since**: 12 16565 16566**Parameters** 16567 16568| Name | Description | 16569| -------------------------- | ------------------------------------------------------------ | 16570| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). | 16571| heightMode | Text height modifier pattern. For details about the available options, see [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior). | 16572 16573 16574### OH_Drawing_TypographyUpdateFontSize() 16575 16576``` 16577void OH_Drawing_TypographyUpdateFontSize (OH_Drawing_Typography* , size_t from, size_t to, float fontSize ) 16578``` 16579 16580**Description** 16581 16582Updates the font size in a typography object. 16583 16584**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing 16585 16586**Since**: 12 16587 16588**Parameters** 16589 16590| Name | Description | 16591| --------------------- | ------------------------------------------------------------ | 16592| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). | 16593| from | Original font size. | 16594| to | New font size. | 16595| fontSize | Font size. |