From e31ebde3872400e470a1be583438e7efc53e48ec Mon Sep 17 00:00:00 2001 From: Gloria Date: Thu, 29 Sep 2022 14:04:06 +0800 Subject: [PATCH] Update docs against 9757+9904+9854+10021+9997 Signed-off-by: wusongqing --- .../js-apis-bundle-ExtensionAbilityInfo.md | 4 +-- .../js-apis-bundle-LauncherAbilityInfo.md | 6 ++-- .../apis/js-apis-bundle-ShortcutInfo.md | 2 +- .../reference/apis/js-apis-effectKit.md | 4 +-- .../reference/apis/js-apis-screenshot.md | 33 +++++++++++++++++-- 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md index 9b11bb2f18..5457c4e315 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md @@ -1,13 +1,11 @@ # ExtensionAbilityInfo - +The **ExtensionAbilityInfo** module provides Extension ability information. Unless otherwise specified, all attributes are obtained through [getBundleInfo](js-apis-Bundle.md#bundlegetbundleinfo), and flags are obtained through [GET_BUNDLE_DEFAULT](js-apis-Bundle.md#bundleflag). > **NOTE** > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. -The **ExtensionAbilityInfo** module provides Extension ability information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. - ## ExtensionAbilityInfo **System capability**: SystemCapability.BundleManager.BundleFramework diff --git a/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md index 3a00ac698a..ef19c14e94 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md @@ -1,6 +1,6 @@ # LauncherAbilityInfo -The **LauncherAbilityInfo** module provides information about a launcher ability. +The **LauncherAbilityInfo** module provides information about the launcher ability, which is obtained through [innerBundleManager.getLauncherAbilityInfos](js-apis-Bundle-InnerBundleManager.md). > **NOTE** > @@ -12,8 +12,8 @@ The **LauncherAbilityInfo** module provides information about a launcher ability **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Readable| Writable| Description | -| --------------- | ---------------------------------------------------- | ---- | ---- | ------------------------------------ | +| Name | Type | Readable| Writable| Description | +| --------------- | ---------------------------------------------------- | ---- | ---- | -------------------------------------- | | applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application information of the launcher ability.| | elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Element name of the launcher ability. | | labelId | number | Yes | No | Label ID of the launcher ability. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md index d45f34389b..9e70a90e4f 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md @@ -1,6 +1,6 @@ # ShortcutInfo -The **ShortcutInfo** module provides shortcut information defined in the configuration file. +The **ShortcutInfo** module provides shortcut information defined in the configuration file. For details about the configuration in the FA model, see [config.json](../../quick-start/package-structure.md). For details about the configuration in the stage model, see [Internal Structure of the shortcuts Attribute](../../quick-start/stage-structure.md#internal-structure-of-the-shortcuts-attribute). > **NOTE** > diff --git a/en/application-dev/reference/apis/js-apis-effectKit.md b/en/application-dev/reference/apis/js-apis-effectKit.md index 498bc3beb3..cf2bb656da 100644 --- a/en/application-dev/reference/apis/js-apis-effectKit.md +++ b/en/application-dev/reference/apis/js-apis-effectKit.md @@ -4,7 +4,7 @@ The **EffectKit** module provides basic image processing capabilities, including This module provides the following classes: -- [Filter](#filter): a class that provides the effect chain. +- [Filter](#filter): a class that provides the effect chain, which is a linked list of image processing effects. - [Color](#color): a class used to store the color picked. - [ColorPicker](#colorpicker): a smart color picker. @@ -155,7 +155,7 @@ Obtains the main color of the image and writes the result to a **[Color](#color) ```js colorPicker.getMainColor().then(color => { console.log('Succeeded in getting main color.'); - console.info("color[ARGB]=" + color.alpha + "," + color.red + "," + color.green + "," + color.blue); + console.info(`color[ARGB]=${color.alpha},${color.red},${color.green},${color.blue}`); }).catch(error => { console.log('Failed to get main color.'); }) diff --git a/en/application-dev/reference/apis/js-apis-screenshot.md b/en/application-dev/reference/apis/js-apis-screenshot.md index 8f88d00f0d..550b62ed35 100644 --- a/en/application-dev/reference/apis/js-apis-screenshot.md +++ b/en/application-dev/reference/apis/js-apis-screenshot.md @@ -55,7 +55,7 @@ Describes the size of the screen region to capture. ## screenshot.save -save(options?: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>): void +save(options: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>): void Takes a screenshot and saves it as a **PixelMap** object. This API uses an asynchronous callback to return the result. @@ -67,7 +67,7 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses an async | Name | Type | Mandatory| Description | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | -| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot settings consist of **screenRect**, **imageSize**, **rotation**, and **displayId**. You can set the parameters separately.| +| options | [ScreenshotOptions](#screenshotoptions) | Yes | Screenshot settings consist of **screenRect**, **imageSize**, **rotation**, and **displayId**. You can set the parameters separately.| | callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | Yes | Callback used to return a **PixelMap** object. | **Example** @@ -97,6 +97,35 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses an async ## screenshot.save +save(callback: AsyncCallback<image.PixelMap>): void + +Takes a screenshot and saves it as a **PixelMap** object. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Required permissions**: ohos.permission.CAPTURE_SCREEN (available only to system applications) + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | +| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | Yes | Callback used to return a **PixelMap** object. | + +**Example** + + ```js + screenshot.save((err, pixelMap) => { + if (err) { + console.log('Failed to save screenshot: ' + JSON.stringify(err)); + return; + } + console.log('Succeeded in saving sreenshot. Pixel bytes number: ' + pixelMap.getPixelBytesNumber()); + pixelMap.release(); // Release the memory in time after the PixelMap is used. + }); + ``` + +## screenshot.save + save(options?: ScreenshotOptions): Promise<image.PixelMap> Takes a screenshot and saves it as a **PixelMap** object. This API uses a promise to return the result. -- GitLab