From 12a4de6688b7b83b283ce71566d7bc86e7058b1d Mon Sep 17 00:00:00 2001 From: yaoyuchi Date: Thu, 13 Jan 2022 20:26:03 +0800 Subject: [PATCH] canvas support get pixelmap Signed-off-by: yaoyuchi --- api/@internal/component/ets/canvas.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index c860017b28..75771b8d29 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -701,6 +701,16 @@ declare class CanvasRenderer extends CanvasPath { */ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + /** + * Obtains the PixelMap of a specified area on the current canvas. + * @param sx x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param sy y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. + * @param sw The width of the rectangular area of the PixelMap to be extracted. + * @param sh The height of the rectangular area of the PixelMap to be extracted. + * @since 8 + */ + getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap; + /** * Draws the specified ImageData object onto the canvas * @param imagedata ImageData object to be drawn. -- Gitee