diff --git a/api/@ohos.graphics.drawing.d.ts b/api/@ohos.graphics.drawing.d.ts index 8365a1cc4286eb486016088e00b37bef3df27daa..5469a281cfed2285e83b527c7720acad07278b61 100644 --- a/api/@ohos.graphics.drawing.d.ts +++ b/api/@ohos.graphics.drawing.d.ts @@ -140,7 +140,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. * @syscap SystemCapability.Graphics.Drawing * @since 11 */ @@ -341,7 +342,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 +369,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 @@ -675,7 +678,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 +716,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 @@ -1349,7 +1354,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 +1393,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 +1407,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. @@ -1685,8 +1693,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. @@ -2049,8 +2057,6 @@ declare namespace drawing { * @since 12 */ uniqueID(): number; - - } /** @@ -2698,7 +2704,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 @@ -2800,7 +2807,7 @@ declare namespace drawing { * the decimal part is discarded and converted into an integer. * @param { Array | null } fRectTypes - Array that holds the rectangle types. The default value is null. * If this parameter is specified, the array size must be (fXCount + 1) * (fYCount + 1). - * @param { Array | null } fColors - Array that holds the colors used to fill the lattices. + * @param { Array | null } fColors - Array that holds the colors used to fill the lattices. * Each color is represented by a 32-bit unsigned integer in hexadecimal ARGB format. * The default value is null. If this parameter is specified, the array size must be (fXCount + 1) * (fYCount + 1). * @returns { Lattice } Lattice object. @@ -3374,6 +3381,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 @@ -4256,7 +4264,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, @@ -4282,19 +4291,6 @@ declare namespace drawing { */ 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 * given degree around the rotation point (px, py). @@ -4349,6 +4345,19 @@ 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