diff --git a/api/@ohos.graphics.drawing.d.ts b/api/@ohos.graphics.drawing.d.ts index 8365a1cc4286eb486016088e00b37bef3df27daa..b42b8224407bd663583281f963fad8ebbf269fb8 100644 --- a/api/@ohos.graphics.drawing.d.ts +++ b/api/@ohos.graphics.drawing.d.ts @@ -20,7 +20,6 @@ import type image from './@ohos.multimedia.image'; import type common2D from './@ohos.graphics.common2D'; -import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; import { Resource } from './global/resource'; /** @@ -32,10 +31,9 @@ import { Resource } from './global/resource'; */ declare namespace drawing { /** - * Enumerates the blend modes. A blend mode combines two colors (source color and destination color) in a specific way to create a new color. - * This is commonly used in graphics operations like overlaying, filtering, and masking. - * The blending process applies the same logic to the red, green, and blue color channels separately. - * The alpha channel, however, is handled according to the specific definitions of each blend mode. + * Enumerates the blend modes. In blend mode, each operation generates a new color form 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: * @@ -140,7 +138,8 @@ declare namespace drawing { */ MODULATE = 13, /** - * r = s + d - s * d, inverts the color values of the source and destination pixels, multiplies them, and then inverts the result, typically producing a brighter outcome. + * r = s + d - s * d, inverts the color values of the source and destination pixels, multiplies them, and then inverts the result, typically producing a brighter outcome. + * and then inverts the result, typically producing a brighter outcome. * @syscap SystemCapability.Graphics.Drawing * @since 11 */ @@ -341,7 +340,8 @@ declare namespace drawing { constructor(roundRect: RoundRect); /** - * A constructor used to create a RoundRect object. A rounded rectangle is created when both xRadii and yRadii are greater than 0. Otherwise, only a rectangle is created. + * A constructor used to create a RoundRect object. A rounded rectangle is created when both xRadii and yRadii are greater than 0. + * Otherwise, only a rectangle is created. * @param { common2D.Rect } rect - Rectangle that encloses the rounded rectangle to create. * @param { number } xRadii - Radius of the rounded corner on the X axis. The value is a floating point number. A negative number is invalid. * @param { number } yRadii - Radius of the rounded corner on the Y axis. The value is a floating point number. A negative number is invalid. @@ -367,7 +367,8 @@ declare namespace drawing { /** * Obtains the radii of the specified rounded corner in this rounded rectangle. * @param { CornerPos } pos - Position of the rounded corner. - * @returns { common2D.Point } Point. The horizontal coordinate indicates the radius of the rounded corner on the X axis, and the vertical coordinate indicates the radius on the Y axis. + * @returns { common2D.Point } Point. The horizontal coordinate indicates the radius of the rounded corner on the X axis, + * and the vertical coordinate indicates the radius on the Y axis. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Graphics.Drawing @@ -625,7 +626,8 @@ declare namespace drawing { * @param { number } endY - Y coordinate of the target point. The value is a floating point number. * @param { number } 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 API has the same effect as lineTo. If the value is 1, it has the same effect as quadTo. The value is a floating point number. + * this API is equivalent to lineTo, that is, adding a line segment from the last point of the path to the target point. + * If the value is 1, this APi is equivalment to quadTo. The value is a floating point number. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing @@ -675,7 +677,8 @@ declare namespace drawing { rLineTo(dx: number, dy: number): void; /** - * 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. + * 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. * @param { number } dx1 - X offset of the control point relative to the last point. A positive number indicates a rightward shift from the last point, * and a negative number indicates a leftward shift from the last point. The value is a floating point number. * @param { number } dy1 - Y offset of the control point relative to the last point. A positive number indicates an upward shift from the last point, @@ -712,7 +715,8 @@ declare namespace drawing { rConicTo(ctrlX: number, ctrlY: number, endX: number, endY: number, weight: number): void; /** - * Draws a cubic 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. + * Draws a cubic 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. * @param { number } ctrlX1 - X offset of the first control point relative to the last point. A positive number indicates a rightward shift * from the last point, and a negative number indicates a leftward shift from the last point. The value is a floating point number. * @param { number } ctrlY1 - Y offset of the first control point relative to the last point. A positive number indicates an upward shift @@ -1023,8 +1027,7 @@ declare namespace drawing { * If a value greater than the path length is passed in, the path length is used. The value is a floating point number. * @param { Matrix } matrix - Matrix object used to store the matrix obtained. * @param { PathMeasureMatrixFlags } flags - Type of the matrix information obtained. - * @returns { boolean } - Result indicating whether the transformation matrix is obtained. - * The value true means that the operation is successful, and false means the opposite. + * @returns { boolean } - Check Result. The value true means that a transformation matrix is obtained, and false means the opposite. * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. * @syscap SystemCapability.Graphics.Drawing * @since 12 @@ -1035,7 +1038,7 @@ declare namespace drawing { * Parses the path represented by an SVG string. * * @param { string } str - String in SVG format, which is used to describe the path. - * @returns { boolean } Result of the parsing operation. The value true means that the operation is successful, and false means the opposite. + * @returns { boolean } Check result. The value true means that the parsing is successful, and false means the opposite. * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. * @syscap SystemCapability.Graphics.Drawing * @since 12 @@ -1051,51 +1054,6 @@ declare namespace drawing { */ getPathIterator(): PathIterator; - /** - * Approximates the path with a series of line segments. - * - * @param { number } acceptableError - Indicates the acceptable error for a line on the path. Should be no less than 0. - * @returns { Array } - Returns with the array containing point components. - *
There are three components for each point: - *
1. Fraction along the length of the path that the point resides [0.0, 1.0]. - *
2. The x coordinate of the point. - *
3. The y coordinate of the point. - * @throws { BusinessError } 25900001 - Parameter error. Possible causes: Incorrect parameter range. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - approximate(acceptableError: number): Array; - - /** - * Performs interpolation between the current path and another path based on a given weight, and stores the result in the target path object. - * - * @param { Path } other - Indicates the other path to be interpolated with the current path. - * @param { number } weight - Indicates the interpolation weight, which must be in the range [0, 1]. - * @param { Path } interpolatedPath - Indicates the target path object where the interpolation result will be stored. - * @returns { boolean } - Returns true if the interpolation operation was successful; returns false otherwise. - *
Possible reasons for failure include: - *
1. The 'other' is incompatible with the current path. - *
2. The 'weight' is outside the [0, 1] range. - * @throws { BusinessError } 25900001 - Parameter error. Possible causes: Incorrect parameter range. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - interpolate(other: Path, weight: number, interpolatedPath: Path): boolean; - - /** - * Checks whether the current path is compatible with another path (other) for interpolation, which means - * they have exactly the same structure, both paths must have the same operations, in the same order. - * If any of the operations are of type PathIteratorVerb.CONIC, then the weights of those conics must also match. - * - * @param { Path } other - Indicates the path to be checked for compatibility with the current path. - * @returns { boolean } - Returns true if the current path and the other path are compatible for interpolation; returns false otherwise. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - isInterpolate(other: Path): boolean; } /** @@ -1349,7 +1307,8 @@ declare namespace drawing { drawImage(pixelmap: image.PixelMap, left: number, top: number, samplingOptions?: SamplingOptions): void; /** - * Splits an image into multiple sections based on the lattice object's configuration and draws each section into the specified target rectangle on the canvas. + * Splits an image into multiple sections based on the lattice object's configuration and + * draws each section into the specified target rectangle on the canvas. * The intersections of even-numbered rows and columns (starting from 0) are fixed points. * If the fixed lattice area fits within the target rectangle, it will be drawn without scaling. * Otherwise, it will be scaled proportionally to fit the target rectangle. @@ -1387,7 +1346,8 @@ declare namespace drawing { * Draws an image onto a specified area of the canvas. * @param { image.PixelMap } pixelmap - The source image. * @param { common2D.Rect } dstRect - Rectangle object, which specifies the area of the canvas onto which the image will be drawn. - * @param { SamplingOptions } samplingOptions - Sampling options. By default, the SamplingOptions object created using the no-argument constructor is used. + * @param { SamplingOptions } samplingOptions - Sampling options. + * By default, the SamplingOptions object created using the no-argument constructor is used. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing @@ -1400,7 +1360,8 @@ declare namespace drawing { * @param { image.PixelMap } pixelmap - The source image. * @param { common2D.Rect } srcRect - Rectangle object, which specifies the portion of the image to draw. * @param { common2D.Rect } dstRect - Rectangle object, which specifies the area of the canvas onto which the image will be drawn. - * @param { SamplingOptions } samplingOptions - Sampling options. By default, the SamplingOptions object created using the no-argument constructor is used. + * @param { SamplingOptions } samplingOptions - Sampling options. + * By default, the SamplingOptions object created using the no-argument constructor is used. * @param { SrcRectConstraint } constraint - Constraint type of the source rectangle. The default value is STRICT. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. @@ -1411,9 +1372,9 @@ declare namespace drawing { samplingOptions?: SamplingOptions, constraint?: SrcRectConstraint): void; /** - * Fills the drawable area of the canvas with the specified color and blend mode. - * @param { common2D.Color } color - Color in ARGB format. The value of each color channel is an integer ranging from 0 to 255. - * @param { BlendMode } blendMode - Blend mode. The default mode is SRC_OVER. + * Draws the background color. + * @param { common2D.Color } color - The range of color channels must be [0, 255]. + * @param { BlendMode } blendMode - Used to combine source color and destination. The default value is SRC_OVER. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Graphics.Drawing @@ -1498,7 +1459,7 @@ declare namespace drawing { drawArcWithCenter(arc: common2D.Rect, startAngle: number, sweepAngle: number, useCenter: boolean): void; /** - * Draws a point. + * Draw a point. * @param { number } x - X coordinate of the point. The value is a floating point number. * @param { number } y - Y coordinate of the point. The value is a floating point number. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; @@ -1649,7 +1610,7 @@ declare namespace drawing { * If you call restore, changes made to the matrix and clipping region are discarded, and the PixelMap is drawn. * @param { common2D.Rect | null} rect - Rect object, which is used to limit the size of the graphics layer. * The default value is the current canvas size. - * @param { Brush | null} brush - Brush object. The alpha value, filter effect, and blend mode of the brush are applied when the PixelMap is drawn. + * @param { Brush | null} brush - 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. * @returns { number } Number of canvas statuses that have been saved. The value is a positive integer. * @throws { BusinessError } 401 - Parameter error. Possible causes: Mandatory parameters are left unspecified. @@ -1660,7 +1621,7 @@ declare namespace drawing { /** * Clears the canvas with a given color. This API has the same effect as drawColor. - * @param { common2D.Color } color - Color in ARGB format. The value of each color channel is an integer ranging from 0 to 255. + * @param { common2D.Color } color - Color in ARGB format. Each color channel is an integer ranging from 0 to 255. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing @@ -1685,8 +1646,8 @@ declare namespace drawing { /** * Restores the canvas state (canvas matrix and clipping area) to a specified number. - * @param { number } count - Depth of the canvas statuses to restore. - * The value is an integer. If the value is less than or equal to 1, the canvas is restored to the initial state. + * @param { number } count - Depth of the canvas statuses to restore. The value is an integer + * 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. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. @@ -2044,13 +2005,11 @@ declare namespace drawing { /** * Obtains the unique, non-zero identifier of this TextBlob object. - * @returns { number } Unique, non-zero identifier of this TextBlob object. + * @returns { number } Unique ID. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ uniqueID(): number; - - } /** @@ -2221,7 +2180,7 @@ declare namespace drawing { } /** - * Describes the attributes used for text rendering, such as size and typeface. + * Describes the attributes, such as the size, used for drawing text. * * @syscap SystemCapability.Graphics.Drawing * @since 11 @@ -2261,8 +2220,8 @@ declare namespace drawing { enableLinearMetrics(isLinearMetrics: boolean): void; /** - * Sets the font size. - * @param { number } textSize - Font size. The value is a floating point number. + * Sets the text size. + * @param { number } textSize - Text size. The value is a floating point number. * If a negative number is passed in, the size is set to 0. If the size is 0, the text drawn will not be displayed. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. @@ -2272,8 +2231,8 @@ declare namespace drawing { setSize(textSize: number): void; /** - * Obtains the font size. - * @returns { number } Font size. The value is a floating point number. + * Obtains the text size. + * @returns { number } Text size. The value is a floating point number. * @syscap SystemCapability.Graphics.Drawing * @since 11 */ @@ -2281,7 +2240,7 @@ declare namespace drawing { /** * Sets the typeface style (including attributes such as font name, weight, and italic) for the font. - * @param { Typeface } typeface - Typeface style (including attributes such as font name, weight, and italic). + * @param { Typeface } typeface - Font and style used to draw text. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing @@ -2698,7 +2657,8 @@ declare namespace drawing { xMin?: number; /** - * Horizontal distance from the rightmost edge of any glyph bounding box to the origin. The value is a positive number, indicating the maximum horizontal coordinate across all glyph bounding boxes. + * Horizontal distance from the rightmost edge of any glyph bounding box to the origin. + * The value is a positive number, indicating the maximum horizontal coordinate across all glyph bounding boxes. * @type { ?number } * @syscap SystemCapability.Graphics.Drawing * @since 12 @@ -3021,7 +2981,7 @@ declare namespace drawing { /** * Creates a ShaderEffect object that generates a radial gradient based on the center and radius of a circle. - * A radial gradient refers to the color transition that spreads out gradually from the center of a circle. + * The radial gradient transitions colors from the center to the ending shape in a radial manner. * @param { common2D.Point } centerPt - Center of the circle. * @param { number } radius - Radius of the gradient. A negative number is invalid. The value is a floating point number. * @param { Array } colors - Array of colors to distribute between the center and ending shape of the circle. @@ -3043,8 +3003,8 @@ declare namespace drawing { mode: TileMode, pos?: Array | null, matrix?: Matrix | null): ShaderEffect; /** - * Creates a ShaderEffect object that generates a color sweep gradient around a given center point, - * either in a clockwise or counterclockwise direction. + * Creates a ShaderEffect object that generates a sweep gradient based on the center. + * A sweep gradient paints a gradient of colors in a clockwise or counterclockwise direction base on a given circle center. * @param { common2D.Point } centerPt - Center of the circle. * @param { Array } colors - Array of colors to distribute between the start angle and end angle. * The values in the array are 32-bit (ARGB) unsigned integers. @@ -3374,6 +3334,7 @@ declare namespace drawing { * @param { ImageFilter } foreground - Indicates the input foreground filter. * @returns { ImageFilter } ImageFilter object. * @throws { BusinessError } 25900001 - Parameter error. Possible causes: Incorrect parameter range. + *
2. Incorrect Parameter types. * @static * @syscap SystemCapability.Graphics.Drawing * @crossplatform @@ -3591,18 +3552,6 @@ declare namespace drawing { */ setColor(color: number): void; - /** - * Set the color by four floating point values, unpremultiplied. The color values are interpreted as being in - * the colorSpace. If colorSpace is nullptr, then color is assumed to be in the sRGB color space. - * - * @param { common2D.Color4f } color4f - Indicates four floating point values that describes the color. - * @param { colorSpaceManager.ColorSpaceManager | null } colorSpace - Indicates colorSpaceManager. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - setColor4f(color4f: common2D.Color4f, colorSpace: colorSpaceManager.ColorSpaceManager | null): void; - /** * Obtains the color of this pen. * @returns { common2D.Color } Returns a 32-bit (ARGB) variable that describes the color. @@ -3611,15 +3560,6 @@ declare namespace drawing { */ getColor(): common2D.Color; - /** - * Obtains the color of a pen. The color is used by the pen to outline a shape. - * @returns { common2D.Color4f } Returns four floating point values that describes the color. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - getColor4f(): common2D.Color4f; - /** * Obtains the color of this pen. * @returns { number } Returns a 32-bit (ARGB) variable that describes the color of hexadecimal format. @@ -3643,7 +3583,7 @@ declare namespace drawing { /** * Obtains the stroke width of this pen. The width describes the thickness of the outline of a shape. - * @returns { number } Stroke width for the pen, in px. + * @returns { number } Returns the thickness. * @syscap SystemCapability.Graphics.Drawing * @since 12 */ @@ -3651,7 +3591,6 @@ declare namespace drawing { /** * Enables anti-aliasing for this pen. Anti-aliasing makes the edges of the content smoother. - * If this API is not called, anti-aliasing is disabled by default. * * @param { boolean } aa - Whether to enable anti-aliasing. The value true means to enable anti-aliasing, and false means the opposite. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; @@ -3770,7 +3709,7 @@ declare namespace drawing { setDither(dither: boolean): void; /** - * Sets the join style for this pen. If this API is not called, the default join style is MITER_JOIN. + * Sets the join style for this pen. * * @param { JoinStyle } style - Join style. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; @@ -3790,7 +3729,7 @@ declare namespace drawing { getJoinStyle(): JoinStyle; /** - * Sets the cap style for this pen. If this API is not called, the default cap style is FLAT_CAP. + * Sets the cap style for this pen. * * @param { CapStyle } style - Cap style. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; @@ -3889,18 +3828,6 @@ declare namespace drawing { */ setColor(color: number): void; - /** - * Sets the color by four floating point values, unpremultiplied. The color values are interpreted as being in - * the colorSpace. If colorSpace is nullptr, then color is assumed to be in the sRGB color space. - * - * @param { common2D.Color4f } color4f - Indicates four floating point values that describes the color. - * @param { colorSpaceManager.ColorSpaceManager | null } colorSpace - Indicates colorSpaceManager. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - setColor4f(color4f: common2D.Color4f, colorSpace: colorSpaceManager.ColorSpaceManager | null): void; - /** * Obtains the color of this brush. * @returns { common2D.Color } Returns a 32-bit (ARGB) variable that describes the color. @@ -3909,15 +3836,6 @@ declare namespace drawing { */ getColor(): common2D.Color; - /** - * Obtains the color of a brush. The color is used by the brush to outline a shape. - * @returns { common2D.Color4f } Returns four floating point values that describes the color. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - getColor4f(): common2D.Color4f; - /** * Obtains the color of this brush. * @returns { number } Returns a 32-bit (ARGB) variable that describes the color of hexadecimal format. @@ -3928,7 +3846,6 @@ declare namespace drawing { /** * Enables anti-aliasing for this brush. Anti-aliasing makes the edges of the content smoother. - * If this API is not called, anti-aliasing is disabled by default. * @param { boolean } aa - Whether to enable anti-aliasing. The value true means to enable anti-aliasing, and false means the opposite. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. @@ -4021,7 +3938,7 @@ declare namespace drawing { setShaderEffect(shaderEffect: ShaderEffect): void; /** - * Sets a blend mode for this brush. If this API is not called, the default blend mode is SRC_OVER. + * Sets a blend mode for this brush. * @param { BlendMode } mode - Blend mode. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. @@ -4215,8 +4132,7 @@ declare namespace drawing { /** * Inverts this matrix and returns the result. * @param { Matrix } matrix - Matrix object used to store the inverted matrix. - * @returns { Boolean } Check result. The value true means that the matrix is revertible and the matrix object is set to its inverse, - * and false means that the matrix is not revertible and the matrix object remains unchanged. + * @returns { Boolean } Returns true if matrix can be inverted; returns false otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing @@ -4256,7 +4172,8 @@ declare namespace drawing { */ postRotate(degree: number, px: number, py: number): void; /** - * Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been scaled with the coefficient (sx, sy) at the scale point (px, py). + * Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been + * scaled with the coefficient (sx, sy) at the scale point (px, py). * @param { number } sx - Scale coefficient along the X axis. If a negative number is passed in, * the matrix is mirrored around y = px before being scaled. The value is a floating point number. * @param { number } sy - Scale coefficient along the Y axis. If a negative number is passed in, @@ -4281,19 +4198,6 @@ declare namespace drawing { * @since 12 */ postTranslate(dx: number, dy: number): void; - - /** - * Sets matrix to matrix multiplied by matrix constructed from skewing by (kx, ky) about pivot point (px, py). - * This can be thought of as scaling relative to a pivot point before applying matrix. - * @param { number } kx - Indicates the horizontal skew factor. - * @param { number } ky - Indicates the vertical skew factor. - * @param { number } px - Indicates the pivot on x-axis. - * @param { number } py - Indicates the pivot on y-axis. - * @syscap SystemCapability.Graphics.Drawing - * @crossplatform - * @since 20 - */ - preSkew(kx: number, ky: number, px: number, py: number): void; /** * Premultiplies this matrix by a matrix that is derived from an identity matrix after it has been rotated by a @@ -4349,6 +4253,20 @@ declare namespace drawing { * @since 12 */ preTranslate(dx: number, dy: number): void; + + /** + * Sets matrix to matrix multiplied by matrix constructed from skewing by (kx, ky) about pivot point (px, py). + * This can be thought of as scaling relative to a pivot point before applying matrix. + * @param { number } kx - Indicates the horizontal skew factor. + * @param { number } ky - Indicates the vertical skew factor. + * @param { number } px - Indicates the pivot on x-axis. + * @param { number } py - Indicates the pivot on y-axis. + * @syscap SystemCapability.Graphics.Drawing + * @crossplatform + * @since 20 + */ + preSkew(kx: number, ky: number, px: number, py: number): void; + /** * Resets this matrix to an identity matrix. * @syscap SystemCapability.Graphics.Drawing @@ -4404,10 +4322,10 @@ declare namespace drawing { * @param { common2D.Rect } src - Source rectangle. * @param { common2D.Rect } dst - Destination rectangle. * @param { ScaleToFit } scaleToFit - Mapping mode from the source rectangle to the target rectangle. - * @returns { boolean } Check result. The value true means that the matrix can represent the mapping, and false means the opposite. - * If either the width or the height of the source rectangle is less than or equal to 0, the API returns false - * and sets the matrix to an identity matrix. If either the width or height of the destination rectangle is less than or equal to 0, - * the API returns true and sets the matrix to a matrix with all values 0, except for a perspective scaling coefficient of 1. + * @returns { boolean } Returns true if dst is empty, and sets matrix to: + | 0 0 0 | + | 0 0 0 | + | 0 0 1 | * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Graphics.Drawing @@ -4751,8 +4669,7 @@ declare namespace drawing { } /** - * Enumerates the constraints on the source rectangle. - * It is used to specify whether to limit the sampling range within the source rectangle when drawing an image on a canvas. + * Enumerates the constraints types of the source rectangle. * * @enum { number } * @syscap SystemCapability.Graphics.Drawing