diff --git a/zh-cn/application-dev/reference/apis/js-apis-screenshot.md b/zh-cn/application-dev/reference/apis/js-apis-screenshot.md index e0709a93244e89897df4336fd172e6c62934c60f..ab64630c12f7cc86e30a9c3132fc5cb270737c53 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-screenshot.md +++ b/zh-cn/application-dev/reference/apis/js-apis-screenshot.md @@ -17,11 +17,12 @@ import screenshot from '@ohos.screenshot'; **系统能力:** SystemCapability.WindowManager.WindowManager.Core -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------- | ---- | ------------------------------------------------------------ | -| screenRect | [Rect](#rect) | 否 | 表示截取图像的区域,不传值默认为全屏。| -| imageSize | [Size](#size) | 否 | 表示截取图像的大小,不传值默认为全屏。| -| rotation | number | 否 | 表示截取图像的旋转角度,当前仅支持输入值为0,默认值为0。| +| 参数名 | 类型 | 必填 | 说明 | +| ---------------------- | ------------- | ---- | ------------------------------------------------------------ | +| screenRect | [Rect](#rect) | 否 | 表示截取图像的区域,不传值默认为全屏。 | +| imageSize | [Size](#size) | 否 | 表示截取图像的大小,不传值默认为全屏。 | +| rotation | number | 否 | 表示截取图像的旋转角度,当前仅支持输入值为0,默认值为0。 | +| displayId8+ | number | 否 | 表示截取图像的显示设备[Display](js-apis-display.md#display)的ID号。 | ## Rect @@ -61,10 +62,10 @@ save(options?: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>) **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | - | options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect,imageSize,rotation三个参数,需要分别设置这三个参数。 | - | callback | AsyncCallback<image.PixelMap> | 是 | 回调返回一个PixelMap对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | +| options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect,imageSize,rotation, displayId四个参数,可以分别设置这四个参数。 | +| callback | AsyncCallback<image.PixelMap> | 是 | 回调返回一个PixelMap对象。 | **示例:** @@ -78,7 +79,8 @@ save(options?: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>) "imageSize": { "width": 300, "height": 300}, - "rotation": 0 + "rotation": 0, + "displayId": 0 }; screenshot.save(ScreenshotOptions, (err, data) => { if (err) { @@ -103,13 +105,13 @@ save(options?: ScreenshotOptions): Promise<image.PixelMap> | 参数名 | 类型 | 必填 | 说明 | | ------- | --------------------------------------- | ---- | ------------------------------------------------------------ | -| options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect、imageSize、rotation三个参数,需要分别设置这三个参数。 | +| options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect、imageSize、rotation、displayId四个参数,可以分别设置这四个参数。 | **返回值:** - | 类型 | 说明 | - | ----------------------------- | ----------------------------------------------- | - | Promise<image.PixelMap> | 以Promise形式返回结果,返回image.PixelMap对象。 | +| 类型 | 说明 | +| ----------------------------- | ----------------------------------------------- | +| Promise<image.PixelMap> | 以Promise形式返回结果,返回image.PixelMap对象。 | **示例:** @@ -123,7 +125,8 @@ save(options?: ScreenshotOptions): Promise<image.PixelMap> "imageSize": { "width": 300, "height": 300}, - "rotation": 0 + "rotation": 0, + "displayId": 0 }; let promise = screenshot.save(ScreenshotOptions); promise.then(() => {