未验证 提交 e79e4e10 编写于 作者: O openharmony_ci 提交者: Gitee

!10160 翻译完成:9757+9904+9854+10021 多个API少量刷新

Merge pull request !10160 from wusongqing/TR9757
# 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
......
# 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. |
......
# 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**
>
......
......@@ -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.');
})
......
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册