提交 32a281fc 编写于 作者: G Gloria

Update docs against 21356+20546+21588+21442+21778+21341

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 bae87b24
......@@ -39,7 +39,7 @@ Enumerates the initial ability launch reasons. You can use it together with [onC
| CALL | 2 | The ability is started by calling [startAbilityByCall](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilitybycall).|
| CONTINUATION | 3 | The ability is started by means of cross-device migration.|
| APP_RECOVERY | 4 | The ability is automatically started when the application is restored from a fault.|
| SHARE<sup>10+</sup> | 5 | The ability is started by calling [acquireShareData](js-apis-app-ability-abilityManager.md#acquiresharedata).|
| SHARE<sup>10+</sup> | 5 | The ability is started by means of atomic service sharing.|
**Example**
......
......@@ -392,6 +392,8 @@ Called by a system dialog box to obtain shared data, which is set by the target
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory | Description |
......@@ -433,6 +435,8 @@ Called by a system dialog box to obtain shared data, which is set by the target
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory | Description |
......
......@@ -202,7 +202,7 @@ Called to save data during the ability migration preparation process.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.|
| wantParam | {[key:&nbsp;string]:&nbsp;Object} | Yes| **want** parameter.|
**Return value**
......@@ -289,7 +289,7 @@ Called when the framework automatically saves the UIAbility state in the case of
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reason | [AbilityConstant.StateType](js-apis-app-ability-abilityConstant.md#abilityconstantstatetype) | Yes| Reason for triggering the callback to save the UIAbility state.|
| wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.|
| wantParam | {[key:&nbsp;string]:&nbsp;Object} | Yes| **want** parameter.|
**Return value**
......@@ -315,7 +315,7 @@ class MyUIAbility extends UIAbility {
onShare(wantParam:{ [key: string]: Object }): void;
Called when this UIAbility sets data to share. **ohos.extra.param.key.contentTitle** indicates the title of the content to share in the sharing box, **ohos.extra.param.key.shareAbstract** provides an abstract description of the content, and **ohos.extra.param.key.shareUrl** indicates the online address of the service. You need to set these three items as objects, with the key set to **title**, **abstract**, and **url**, respectively.
Called by this UIAbility to set data to share. **ohos.extra.param.key.shareUrl** indicates the online address of the service.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
......@@ -332,9 +332,7 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant';
class MyUIAbility extends UIAbility {
onShare(wantParams) {
console.log('onShare');
wantParams['ohos.extra.param.key.contentTitle'] = {title: "OA"};
wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for company employee"};
wantParams['ohos.extra.param.key.shareUrl'] = {url: "oa.example.com"};
wantParams['ohos.extra.param.key.shareUrl'] = 'example.com';
}
}
```
......
......@@ -15,11 +15,11 @@ The **AbilityInfo** module defines the ability information. A system application
| bundleName | string | Yes | No | Bundle name. |
| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. |
| name | string | Yes | No | Ability name. |
| label | string | Yes | No | Ability name visible to users. |
| label | string | Yes | No | Resource descriptor of the ability name visible to users. Example: **"label": "$string: mainability_description"**. |
| labelId | number | Yes | No | ID of the ability label. |
| description | string | Yes | No | Ability description. |
| descriptionId | number | Yes | No | ID of the ability description. |
| icon | string | Yes | No | Index of the ability icon resource file. |
| icon | string | Yes | No | Resource descriptor of the ability icon. Example: **"icon": "$media:icon"**. |
| iconId | number | Yes | No | ID of the ability icon. |
| process | string | Yes | No | Process in which the ability runs. If this parameter is not set, the bundle name is used.|
| exported | boolean | Yes | No | Whether the ability can be called by other bundles. |
......
......@@ -21,7 +21,7 @@ import effectKit from '@ohos.effectKit';
## effectKit.createEffect
createEffect(source: image.PixelMap): Filter
Creates a **Filter** instance based on the pixel map.
Creates a **Filter** instance based on a pixel map.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -53,7 +53,7 @@ image.createPixelMap(color, opts).then((pixelMap) => {
createColorPicker(source: image.PixelMap): Promise\<ColorPicker>
Creates a **ColorPicker** instance based on the pixel map. This API uses a promise to return the result.
Creates a **ColorPicker** instance based on a pixel map. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -83,11 +83,46 @@ image.createPixelMap(color, opts).then((pixelMap) => {
})
```
## effectKit.createColorPicker<sup>10+</sup>
createColorPicker(source: image.PixelMap, region: Array\<number>): Promise\<ColorPicker>
Creates a **ColorPicker** instance for the selected region based on a pixel map. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------- | ---- | -------------------------- |
| source | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | **PixelMap** instance created by the image module. An instance can be obtained by decoding an image or directly created. For details, see [Image Overview](../../media/image-overview.md).|
| region | Array\<number> | Yes | Region of the image from which the color is picked.<br>The array consists of four elements, representing the left, top, right, and bottom positions of the image, respectively. The value of each element must be in the range [0, 1]. The leftmost and topmost positions of the image correspond to 0, and the rightmost and bottom positions correspond to 1. In the array, the third element must be greater than the first element, and the fourth element must be greater than the second element.<br>If no value is passed, the default value [0, 0, 1, 1] is used, indicating that the color region is the entire image.|
**Return value**
| Type | Description |
| ---------------------- | -------------- |
| Promise\<[ColorPicker](#colorpicker)> | Promise used to return the **ColorPicker** instance created.|
**Example**
```js
import image from "@ohos.multimedia.image";
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts).then((pixelMap) => {
effectKit.createColorPicker(pixelMap, [0, 0, 0.5, 0.5]).then(colorPicker => {
console.info("color picker=" + colorPicker);
}).catch(ex => console.error(".error=" + ex.toString()))
})
```
## effectKit.createColorPicker
createColorPicker(source: image.PixelMap, callback: AsyncCallback\<ColorPicker>): void
Creates a **ColorPicker** instance based on the pixel map. This API uses an asynchronous callback to return the result.
Creates a **ColorPicker** instance based on a pixel map. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -116,6 +151,40 @@ image.createPixelMap(color, opts).then((pixelMap) => {
})
```
## effectKit.createColorPicker<sup>10+</sup>
createColorPicker(source: image.PixelMap, region:Array\<number>, callback: AsyncCallback\<ColorPicker>): void
Creates a **ColorPicker** instance for the selected region based on a pixel map. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------ | ---- | -------------------------- |
| source | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes |**PixelMap** instance created by the image module. An instance can be obtained by decoding an image or directly created. For details, see [Image Overview](../../media/image-overview.md). |
| region | Array\<number> | Yes | Region of the image from which the color is picked.<br>The array consists of four elements, representing the left, top, right, and bottom positions of the image, respectively. The value of each element must be in the range [0, 1]. The leftmost and topmost positions of the image correspond to 0, and the rightmost and bottom positions correspond to 1. In the array, the third element must be greater than the first element, and the fourth element must be greater than the second element.<br>If no value is passed, the default value [0, 0, 1, 1] is used, indicating that the color region is the entire image.|
| callback | AsyncCallback\<[ColorPicker](#colorpicker)> | Yes | Callback used to return the **ColorPicker** instance created.|
**Example**
```js
import image from "@ohos.multimedia.image";
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts).then((pixelMap) => {
effectKit.createColorPicker(pixelMap, [0, 0, 0.5, 0.5], (error, colorPicker) => {
if (error) {
console.log('Failed to create color picker.');
} else {
console.log('Succeeded in creating color picker.');
}
})
})
```
## Color
A class that stores the color picked.
......@@ -124,10 +193,10 @@ A class that stores the color picked.
| Name | Type | Readable| Writable| Description |
| ------ | ----- | ---- | ---- | ---------------- |
| red | number | Yes | No | Value of the red component. |
| green | number | Yes | No | Value of the green component. |
| blue | number | Yes | No | Value of the blue component. |
| alpha | number | Yes | No | Value of the alpha component. |
| red | number | Yes | No | Value of the red component. The value range is [0x0, 0xFF]. |
| green | number | Yes | No | Value of the green component. The value range is [0x0, 0xFF]. |
| blue | number | Yes | No | Value of the blue component. The value range is [0x0, 0xFF]. |
| alpha | number | Yes | No | Value of the alpha component. The value range is [0x0, 0xFF]. |
## ColorPicker
......@@ -250,10 +319,16 @@ console.log('get average color =' + color);
isBlackOrWhiteOrGrayColor(color: number): boolean
Checks whether this image is black, white, and gray.
Checks whether a color is black, white, and gray.
**System capability**: SystemCapability.Multimedia.Image.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------- | ---- | -------------------------- |
| color| number | Yes | Color to check. The value range is [0x0, 0xFFFFFFFF].|
**Return value**
| Type | Description |
......
......@@ -145,8 +145,8 @@ Inserts an element at the specified position in this container.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| element | T | Yes| Target element.|
| index | number | Yes| Index of the position where the element is to be inserted.|
| element | T | Yes| Target element.|
**Error codes**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册