提交 2da215c5 编写于 作者: G Gloria 提交者: wusongqing

fixed 1d5531cc from https://gitee.com/wusongqing/docs/pulls/15094

Update docs against 13988+14704

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 bef315d6
...@@ -736,9 +736,15 @@ Rotates this image based on the input angle. This API uses an asynchronous callb ...@@ -736,9 +736,15 @@ Rotates this image based on the input angle. This API uses an asynchronous callb
**Example** **Example**
```js ```js
async function Demo() { var angle = 90.0;
await pixelmap.rotate(90.0); pixelmap.rotate(angle, (err) => {
} if (err) {
console.error("Failed to set rotation.");
return;
} else {
console.log("Succeeded in setting rotation.");
}
})
``` ```
### rotate<sup>9+</sup> ### rotate<sup>9+</sup>
...@@ -942,7 +948,8 @@ Creates an **ImageSource** instance based on the URI. ...@@ -942,7 +948,8 @@ Creates an **ImageSource** instance based on the URI.
**Example** **Example**
```js ```js
let path = this.context.getApplicationContext().fileDirs + "test.jpg"; let context = featureAbility.getContext();
let path = context.getCacheDir() + "test.jpg";
const imageSourceApi = image.createImageSource(path); const imageSourceApi = image.createImageSource(path);
``` ```
...@@ -2039,7 +2046,7 @@ Creates an **ImageCreator** instance by specifying the image width, height, form ...@@ -2039,7 +2046,7 @@ Creates an **ImageCreator** instance by specifying the image width, height, form
| Type | Description | | Type | Description |
| ------------------------------ | --------------------------------------- | | ------------------------------ | --------------------------------------- |
| [ImageCreator](#imagecreator9) | Returns an **ImageCreator** instance if the operation is successful.| | [ImageCreator](#imagecreator9) | Returns an **ImageCreator** instance if the operation is successful.|
**Example** **Example**
...@@ -2524,7 +2531,7 @@ Defines the option for image packing. ...@@ -2524,7 +2531,7 @@ Defines the option for image packing.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ------- | ------ | ---- | ---- | --------------------------------------------------- | | ------- | ------ | ---- | ---- | --------------------------------------------------- |
| format | string | Yes | Yes | Format of the packed image.<br>Currently, the following formats are supported: JPG, PNG, GIF, BMP, Webp, and RAW.| | format | string | Yes | Yes | Format of the packed image.<br>Only the JPG and WebP formats are supported.|
| quality | number | Yes | Yes | Quality of the output image in JPEG encoding. The value ranges from 1 to 100.| | quality | number | Yes | Yes | Quality of the output image in JPEG encoding. The value ranges from 1 to 100.|
| bufferSize<sup>9+</sup> | number | Yes | Yes | Buffer size, which is used to set the image size. The default value is 10 MB.| | bufferSize<sup>9+</sup> | number | Yes | Yes | Buffer size, which is used to set the image size. The default value is 10 MB.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册