@brief OH_Drawing_Point2D defines a two-dimensional coordinate point. OH_Drawing_Corner_Radii defines
rounded corner radii, consisting of an x-axis radius and a y-axis radius.
@brief This struct describes a strut style. The strut style determines the line spacing, baseline alignment mode,
and other properties related to the line height when drawing text.
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.
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.
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.
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.
Header ellipsis mode, that is, the ellipsis appears at the beginning of a line. This enumerated value is valid
only when the maximum number of text lines is set to 1 by calling
{@link OH_Drawing_SetTypographyTextMaxLines}.
Middle ellipsis mode, that is, the ellipsis appears in the middle of a line. This enumerated value is valid only
when the maximum number of text lines is set to 1 by calling {@link OH_Drawing_SetTypographyTextMaxLines}.
End ellipsis mode, that is, the ellipsis appears at the end of a line. This enumerated value is valid when the
maximum number of text lines is set to any value by calling {@link OH_Drawing_SetTypographyTextMaxLines}.
For any point in the drawing area, a ray is cast in an arbitrary direction. If the number of intersections
between this ray and the path is odd, the point is deemed inside the path and needs to be colored; if the number
is even, it remains uncolored.
For any point within the drawing area, a ray is cast in an arbitrary direction. The count starts at 0 for all
intersections between this ray and the path. Each clockwise intersection—where the path crosses the ray from
left to right—results in the count being incremented by 1, while each counterclockwise intersection—where the
path crosses the ray from right to left—causes the count to be decremented by 1. A point is deemed inside the
path and needs to be colored if the final count is non-zero; if the count is 0, the point remains uncolored.
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.
When OH_Drawing_TextDirection is set to TEXT_DIRECTION_LTR, TEXT_ALIGN_END and TEXT_ALIGN_RIGHT
are the same. Similarly, when OH_Drawing_TextDirection is set to TEXT_DIRECTION_RTL, *TEXT_ALIGN_END
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.
When OH_Drawing_TextDirection is set to TEXT_DIRECTION_LTR, TEXT_ALIGN_START and TEXT_ALIGN_LEFT
are the same. Similarly, when OH_Drawing_TextDirection is set to TEXT_DIRECTION_RTL, **
TEXT_ALIGN_START** and TEXT_ALIGN_RIGHT are the same.
Enables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the top of the first line and
the bottom of the last line in a paragraph.
Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for both the top of the first line
and the bottom of the last line in a paragraph.
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.
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.
@brief Initializes the width and height of a bitmap and sets the pixel format for the bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either bitmap or bitmapFormat is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either imageInfo or pixels is NULL or rowBytes is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is
returned.
@brief Obtains the alpha component of a bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the pixel format of a bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the height of a bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the image information of a bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either bitmap or imageInfo is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the width of a bitmap.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Reads pixels of a rectangle in a bitmap to the specified buffer.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of bitmap, dstInfo, and dstPixels is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Copies an existing {@link OH_Drawing_Brush} object to create a new one.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the color of a brush. The color is used by the brush to fill in a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the {@link OH_Drawing_Filter} object from the brush. The filter is a container that holds a mask
filter and color filter.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either brush or filter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges
semi-transparent.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Resets a brush to the initial state. All configured attributes are cleared.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-
transparent.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a blender for a brush. The blender implements the specified blend mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If blendMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Sets the color for a brush. The color is used by the brush to fill in a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the filter {@link OH_Drawing_Filter} for a brush. The filter is a container that holds a mask filter and
color filter.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the shader effect for a brush.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape.
If the brush effect changes after this function is called, you must call the function again to use the new effect in
the subsequent drawing.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If
the pen effect changes after this function is called, you must call the function again to use the new effect in the
subsequent drawing.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.) A canvas bound to a bitmap is a non-recording canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Clears a canvas by using a given color.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Clips a path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If clipOp is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Clips a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If clipOp is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Clips a rounded rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or roundRect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If clipOp is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Preconcats the existing matrix of the canvas with the passed-in matrix. The drawing operation triggered
before this API is called is not affected.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a
shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a background filled with a brush.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or brush is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a portion of a bitmap onto a specified area of the canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If one of canvas, bitmap, or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a circle. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If
either canvas or point is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If radius is less than or equal to 0, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Draws an image onto a specified area of the canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If one of canvas, image, or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If one of canvas, image, src, or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a line segment.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws an oval. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If
either canvas or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a portion of a pixel map onto a specified area of the canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If one of canvas, pixelMap, or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws multiple points. You can draw a single point, a line segment, or an open polygon.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or point2D is NULL, or count is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is
returned. If mode is not within the enumerated range, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Draws a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or OH_Drawing_Rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a region.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or region is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a rounded rectangle. This API may return an error code. For details, call
{@link OH_Drawing_ErrorCodeGet}. If either canvas or roundRect is NULL,
OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a spot shadow and uses a given path to outline the ambient shadow.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If flag is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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.
@brief Draws a text blob. If the typeface used to construct OH_Drawing_TextBlob does not support a character,
that character will not be drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or textBlob is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a triangular grid described by a vertex array.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either 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.
If either vertexMmode or mode is not set to one of the enumerated values, **
OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
@brief Obtains the canvas height.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the bounds of the cropping region of the canvas. This function cannot be used for a canvas of the
recording type.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the number of canvas statuses (canvas matrices) saved in the stack.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the 3x3 matrix of a canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the canvas width.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Copies pixel data from a canvas to a specified address. This function cannot be used for a canvas of the
recording type.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If one of canvas, imageInfo, or dstPixels is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Copies pixel data from a canvas to an image. This function cannot be used for a canvas of the recording type.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Resets the matrix of this canvas to an identity matrix.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Restores the canvas status (canvas matrix) saved on the top of the stack.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Restores to a given number of canvas statuses (canvas matrices).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value
indicates a counterclockwise rotation.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Saves the current canvas status (canvas matrix) to the top of the stack. This function works with
{@link OH_Drawing_CanvasRestore}.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call
{@link OH_Drawing_CanvasRestore}, changes made to the matrix and clipping region are discarded,
and the bitmap is drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Scales a canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the matrix status for a canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either canvas or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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|
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Translates a canvas by a given distance.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If canvas is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.)
@brief Creates an OH_Drawing_ColorFilter object by combining another two color filters.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either outerColorFilter or innerColorFilter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates an OH_Drawing_ColorFilter object with a given 5x4 color matrix.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates a dashed path effect. The dashed line effect is determined by a group of “on” and “off” intervals.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If intervals is NULL or count is less than or equal to 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Constructs a font descriptor object for describing detailed information about a system font. When the
{@link OH_Drawing_FontDescriptor} is no longer needed, use {@link OH_Drawing_DestroyFontDescriptor} to release the
pointer to the object.
@brief Constructs a font parser object for parsing system fonts. When the {@link OH_Drawing_FontParser} is no longer
needed, use {@link OH_Drawing_DestroyFontParser} to release the pointer to the object.
@brief Creates a pointer to a text shadow object. When the {@link OH_Drawing_TextShadow} is no longer needed, use
{@link OH_Drawing_DestroyTextShadow} to release the pointer to the object.
@brief Creates a pointer to an OH_Drawing_TextStyle object. When the {@link OH_Drawing_TextStyle} is no longer
needed, use {@link OH_Drawing_DestroyTextStyle} to release the pointer to the object.
@brief Creates an OH_Drawing_Typography object. Release this pointer by calling
{@link OH_Drawing_DestroyTypography} when this object is no longer needed.
@brief Creates an OH_Drawing_TypographyCreate object. Release this pointer by calling
{@link OH_Drawing_DestroyTypographyHandler} when this object is no longer needed. You are advised to use the
{@link OH_Drawing_CreateSharedFontCollection} function to create an {@link OH_Drawing_FontCollection} object.
@brief Creates an OH_Drawing_TypographyStyle object. Release this pointer by calling
{@link OH_Drawing_DestroyTypographyStyle} when this object is no longer needed.
@brief Obtains an OH_Drawing_ColorFilter object from an OH_Drawing_Filter object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either filter or colorFilter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets an OH_Drawing_ColorFilter object for an OH_Drawing_Filter object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If filter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets an OH_Drawing_ImageFilter object for an OH_Drawing_Filter object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If filter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets an OH_Drawing_MaskFilter object for an OH_Drawing_Filter object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If filter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the number of glyphs represented by text.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either font or text is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the font edging effect.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the font hinting effect.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the measurement information about a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either font or fontMetrics is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the horizontal scale ratio of this font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the text size of a font object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the horizontal skew factor of a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the typeface of a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the width of each glyph in a string of text.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of font, glyphs, and widths is NULL, or count is 0, OH_DRAWING_ERROR_INVALID_PARAMETER
is returned.
@brief Checks whether bitmaps are used in a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether fake bold is used for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether auto hinting is forcibly used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether linear scaling is used for a font object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether sub-pixel rendering is used for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
@brief Obtains the font family name based on an index. When the returned name is no longer needed, use
{@link OH_Drawing_FontMgrDestroyFamilyName} to release the memory occupied by the name.
@brief Obtains a font style set object based on a specified font family name. When the object is no longer needed,
use {@link OH_Drawing_FontMgrDestroyFontStyleSet} to release it.
@brief Obtains a typeface object based on the specified font style information and font family name. When the object
is no longer needed, use {@link OH_Drawing_TypefaceDestroy} to release it.
@brief Obtains a typeface for the specified character. A null pointer is returned only when no typeface
corresponding to the input UTF-8 character is found in the font management object. When the object is no longer
needed, use {@link OH_Drawing_TypefaceDestroy} to release it.
@brief Obtains the list of system font names. When the list is no longer needed, use
{@link OH_Drawing_DestroySystemFontList} to release the memory. This API is supported only on phones and PC/2-in-1
devices.
@brief Sets a font edging effect.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If fontEdging is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Sets whether to use bitmaps in a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets fake bold for a font by increasing the stroke width.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a font hinting effect.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If fontHinting is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Sets linear scaling for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a horizontal scale factor for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets whether to use sub-pixel rendering for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the text size for a font object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a horizontal skew factor for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a typeface for a font.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the font style. Call {@link OH_Drawing_FontStyleSetFreeStyleName} to release styleName when it is
no longer needed, freeing up the allocated memory.
@brief Obtains the typeface closest to the font style (font weight, font width, and slant). When the object is no
longer needed, use {@link OH_Drawing_TypefaceDestroy} to release it.
@brief Converts text into glyph indices.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of 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.
@brief 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.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either image or bitmap is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates an OH_Drawing_ImageFilter object with a color filter effect. This API may return an error code.
For details, call {@link OH_Drawing_ErrorCodeGet}. If colorFilter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER
is returned.
@brief Obtains the image height, that is, the number of pixel lines.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If image is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the image information. After this function is called, the passed-in image information object is
filled.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either image or imageInfo is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the image width, that is, the number of pixels in each line.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If image is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Multiplies two matrices to produce a new matrix.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of total, a, and b is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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).
@brief 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).
@brief Creates an OH_Drawing_Matrix with the translation attribute.
The matrix is obtained by translating the identity matrix by the distance (dx, dy).
@brief Obtains a matrix value of a given index, which ranges from 0 to 8.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If index is less than 0 or greater than 8, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Inverts a matrix and returns the result.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either matrix or inverse is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether two OH_Drawing_Matrix objects are equal.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either matrix or other is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether an OH_Drawing_Matrix object is an identity matrix.
An identity matrix is as follows: | 1 0 0 || 0 1 0 || 0 0 1 |. This API may return an error code. For details, see
{@link OH_Drawing_ErrorCodeGet}
.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Maps a source point array to a destination point array by means of matrix transformation.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of matrix, src, and dst is NULL or count is less than or equal to 0, **
OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of matrix, src, and dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been rotated by
a given degree around the rotation point (px, py).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px,
py).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been translated
by a given distance (dx, dy).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Premultiplies this matrix by a matrix that is derived from an identity matrix after it has been rotated by a
given degree around the rotation point (px, py).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Premultiplies this matrix by a matrix that is derived from an identity matrix after it has been translated by
a given distance (dx, dy).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Resets a matrix to an identity matrix.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets this matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets matrix parameters for an OH_Drawing_Matrix object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If OH_Drawing_Matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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]. This API may return an
error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If count is less than 0 or greater than 4, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Scales a matrix to map a source rectangle to a destination rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of matrix, src, and dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a matrix as an identity matrix and translates it by a given distance (dx, dy).
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates an OH_Drawing_MemoryStream object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If data is NULL or length is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Adds a circle to a path in the specified direction.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If radius is less than or equal to 0, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Adds an oval to a path in the specified direction.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief 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 counterclockwise.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Transforms the points in a src path by a matrix and adds the new one to the current path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or src is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Transforms the points in a src path by a matrix and adds the new one to the current path with the
specified adding mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or src is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathAddMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Adds a src path to the current path with the specified adding mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or src is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathAddMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Translates a src path by an offset and adds the new one to the current path with the specified adding
mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or src is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathAddMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Adds a polygon to a path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or points is NULL or count is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Adds a rectangle to a path in the specified direction. The start point is the upper left corner of the
rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Adds a rectangle contour to a path in the specified direction.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Adds a rounded rectangle to a path in the specified direction. When the path direction is clockwise, the
start point is at the intersection of the rounded rectangle’s left boundary and its lower left corner. When the path
direction is counterclockwise, the start point is at the intersection point between the left boundary and the upper
left corner.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or roundRect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathDirection is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief 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 scanning degree 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Parses the path represented by an SVG string.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or str is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a line segment from the current point to the start point of this path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether a coordinate point is included in this path. For details, see {@link OH_Drawing_PathFillType}.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates a copy of the {@link OH_Drawing_Path} object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a cubic Bezier curve from the last point of this path to the target point. If the path is empty, the
start point (0, 0) is used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the minimum bounds that enclose a path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the length of a path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains a transformation matrix at a distance from the start point of this path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If flag is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Obtains the coordinates and tangent at a distance from the start point of this path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of path, position, or tangent is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether a path is closed.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a line segment from the last point of this path to the target point. If the path is empty, the start
point (0, 0) is used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the start point of this path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Translates a path by an offset along the X axis and Y axis and adds the new one to the dst path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Combines two paths based on the specified operation mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or srcPath is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If op is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a line segment from the last point of this path to a point relative to the last point. If the path is
empty, the start point (0, 0) is used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is
used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Draws a quadratic Bezier curve from the last point of this path to a point relative to the last point. If the
path is empty, the start point (0, 0) is used.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Resets the path data.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the fill type of a path. The fill type determines how “inside” of the path is drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If pathFillType is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Transforms the points in a path by matrix.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either path or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Transforms the points in a path by matrix, and uses the new one to replace the dst path. If dst is
NULL, the src path is replaced.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either src or matrix is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates a copy of the {@link OH_Drawing_Pen} object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the line cap style of a pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the color of a pen. The color is used by the pen to outline a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the source path outline drawn using this pen and represents it using a destination path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of pen, src, and dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the {@link OH_Drawing_Filter} object from the pen. The filter is a container that holds a mask filter
and color filter.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either pen or filter is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the line join style of a pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-
transparent.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Resets a pen to the initial state.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-
transparent.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a blender for a pen. The blender implements the specified blend mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If blendMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Sets the line cap style for a pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If capStyle is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Sets the color for a pen. The color is used by the pen to outline a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets a filter for a pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the join style for this pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If joinStyle is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the path effect for this pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the shader effect for this pen.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the thickness for a pen. This thickness determines the width of the outline of a shape.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If pen is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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 {@link OH_Drawing_PixelMapGetFromNativePixelMap} or
{@link OH_Drawing_PixelMapGetFromOhPixelMapNative}
.
@brief Copies a source rectangle to create a new one.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either src or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
@brief Obtains the Y coordinate of the lower right corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@return Returns the height of the rectangle, in pixels.
@param rect Pointer to an OH_Drawing_Rect object.
@since 12
@version 1.0
@brief Obtains the X coordinate of the upper left corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the X coordinate of the lower right corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the Y coordinate of the upper left corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether two rectangles intersect and if yes, sets rect to the area of intersection.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either rect or other is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the union of two rectangles.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either rect or other is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the vertical coordinate of the lower right corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the horizontal coordinate of the upper left corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the horizontal coordinate of the lower right corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the vertical coordinate of the upper left corner of a rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether a region contains the specified point.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If region is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Combines two regions based on the specified operation mode.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either region or dst is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If op is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Sets a region to the area described by the path.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If region, path, or clip is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the boundary for an OH_Drawing_Region object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either region or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates an OH_Drawing_RoundRect object. This API may return an error code. For details, call
{@link OH_Drawing_ErrorCodeGet}
.
If rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the radii of the specified rounded corner in a rounded rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If roundRect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Sets the radii of the specified rounded corner in this rounded rectangle.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If roundRect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Creates an OH_Drawing_SamplingOptions object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If mipmapMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Sets the decoration for a text style. Only one decoration can be set. To add multiple decorations, use
{@link OH_Drawing_AddTextStyleDecoration}.
@brief Sets the font weight. Before OpenHarmony 6.1, only variable fonts in system fonts
support font weight adjustment. Starting from OpenHarmony 6.1, both system fonts and variable
fonts in third-party registered fonts support font weight adjustment. For non-variable fonts, the font weight does
not change when the weight value is set to less than semi-bold, and a pseudo-bold effect may be triggered when the
weight value is set to semi-bold or greater.
@brief Sets the default font weight of the typography style. Before OpenHarmony 6.1, only
variable fonts in system fonts support font weight adjustment. Starting from OpenHarmony 6.1,
both system fonts and variable fonts in third-party registered fonts support font weight adjustment. For non-
variable fonts, the font weight does not change when the weight value is set to less than semi-bold, and a pseudo-
bold effect may be triggered when the weight value is set to semi-bold or greater.
@brief Sets the font weight of the text style in the strut style of the typography style. Before
OpenHarmony 6.1, only variable fonts in system fonts support font weight adjustment. Starting from OpenHarmony 6.1, both system fonts and variable fonts in third-party registered fonts support
font weight adjustment. For non-variable fonts, the font weight does not change when the weight value is set to less
than semi-bold, and a pseudo-bold effect may be triggered when the weight value is set to semi-bold or greater.
@brief Creates an OH_Drawing_ShaderEffect object for an image shader. You are advised not to use the function
for the canvas of the capture type because it affects the performance.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either image or samplingOptions is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If either tileX or tileY is not set to one of the enumerated values, **
OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
@brief Creates a ShaderEffect object that generates a linear gradient between two points.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of startPt, endPt, and colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Creates a ShaderEffect object that generates a linear gradient between two points.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of startPt, endPt, and colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either centerPt or colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either centerPt or colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief 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°.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either centerPt or colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Creates an OH_Drawing_ShaderEffect object that generates a gradient between two given circles.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of startPt, endPt, and colors is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If tileMode is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Creates an OH_Drawing_ShadowLayer object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If blurRadius is less than or equal to 0, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is returned.
@brief Creates an OH_Drawing_Surface object using the GPU context to manage the content drawn on the canvas.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If gpuContext is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains a canvas from an OH_Drawing_Surface object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If surface is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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 {@link OH_Drawing_TextBlobBuilderMake} is called.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either textBlobBuilder or font is NULL or count is less than or equal to 0, **
OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
@brief Makes an OH_Drawing_TextBlob object from an OH_Drawing_TextBlobBuilder.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If textBlobBuilder is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If any of text, point2D, and font is NULL or byteLength is 0, **
OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
If textEncoding is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Creates an OH_Drawing_TextBlob object from a string.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either str or font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If textEncoding is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Creates an OH_Drawing_TextBlob object from the text.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either text or font is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
If textEncoding is not set to one of the enumerated values, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE is
returned.
@brief Obtains the bounds of an OH_Drawing_TextBlob object.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If either textBlob or rect is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Obtains the unique identifier of a text blob. The identifier is a non-zero value.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If textBlob is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
@brief Obtains the text shadow container. When the {@link OH_Drawing_TextShadow} is no longer needed, use
{@link OH_Drawing_DestroyTextShadows} to release the pointer to the object.
@brief Creates an OH_Drawing_Typeface object through a file.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If path is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief 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.
This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.
If memoryStream is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
@brief Checks whether the text in the typography object exceeds the line limit. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. It returns false if the line limit is not set using
{@link OH_Drawing_SetTypographyTextMaxLines}.
@brief Obtains the index position and affinity of the character cluster to which the text at the coordinate belongs.
A character cluster refers to a group of one or more characters. When the {@link OH_Drawing_PositionAndAffinity} is
no longer needed, use {@link OH_Drawing_DestroyPositionAndAffinity} to release the pointer to the object.
@brief Obtains the ideographic baseline position of the typography object. This API must be called after
{@link OH_Drawing_TypographyLayout} is called.
@brief Obtains all font metrics from a given line in a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. Otherwise, a null pointer is returned. Release this pointer by
calling {@link OH_Drawing_TypographyDestroyLineFontMetrics} when this object is no longer needed.
@brief Obtains the metrics of a given line or the metrics of the first character in a given line in a typography
object. This function must be called after {@link OH_Drawing_TypographyLayout} is called.
@brief Obtains the line metrics in a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling {@link OH_Drawing_DestroyLineMetrics}
when this object is no longer needed.
@brief Obtains the position information of a specified line in the typography object. For details, see the
{@link OH_Drawing_LineMetrics} struct. This API must be called after {@link OH_Drawing_TypographyLayout} is called.
@brief Obtains the line bounds in a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. This function can only be used to obtain the bounds of existing lines.
That is, the line index must start from 0, and the maximum index is {@link OH_Drawing_TypographyGetLineCount} – 1.
@brief Obtains the width of the longest line in a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. You are advised to round up the return value. If the text content is
empty, 0.0 is returned.
@brief Obtains text boxes for placeholders in a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling
{@link OH_Drawing_TypographyDestroyTextBox} when this object is no longer needed.
@brief Obtains text boxes in a given range of a typography object. This function must be called after
{@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling
{@link OH_Drawing_TypographyDestroyTextBox} when this object is no longer needed.
@brief Obtains the number of unresolved glyphs in a typography object. This function can be called only after
{@link OH_Drawing_TypographyLayout} is called and applied.
@brief Obtains the word boundary in the typography object. When the {@link OH_Drawing_Range} is no longer needed,
use {@link OH_Drawing_ReleaseRangeBuffer} to release the pointer to the object.
@brief Performs layout calculation on the typography object and wraps text based on the specified maximum width.
After this API is called, the properties of the typography object can be correctly obtained.
@brief Draws text from the upper left corner at a specified position. This function must be called after
{@link OH_Drawing_TypographyLayout} is called and applied.
@brief Draws text along a specified path. This API must be called after {@link OH_Drawing_TypographyLayout} is
called and takes effect. It is recommended to use {@link OH_Drawing_SetTypographyTextMaxLines} to set the maximum
number of lines to 1 to avoid overlapping issues caused by text width exceeding the typography width.
@brief Checks whether two typography styles are the same. The text height modifier mode
{@link OH_Drawing_TextHeightBehavior} is not involved in the comparison.
@brief 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.
@brief 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.
@brief Defines an enum for blend modes. In blend mode, each operation generates a new color from two colors (source
color and destination color).
These operations are the same for the red, green, and blue color channels (the alpha channel follows a different
rule).
For simplicity, the following description uses the alpha channel as an example rather than naming each channel
individually. For brevity, the following abbreviations are used:
s: source.
d: destination.
sa: source alpha.
da: destination alpha.
The following abbreviations are used in the calculation result:
r: The calculation methods of the four channels are the same.
ra: used when only the alpha channel is manipulated.
rc: used when the other three color channels are manipulated.