From 37121462338a512a12fa48a095e89f1218558f2e Mon Sep 17 00:00:00 2001 From: renhw Date: Wed, 15 Feb 2023 01:52:03 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9image=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: renhw --- zh-cn/application-dev/reference/apis/js-apis-image.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-image.md b/zh-cn/application-dev/reference/apis/js-apis-image.md index 05d5f7c4e5..37e3873ff9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -947,7 +947,8 @@ createImageSource(uri: string): ImageSource **示例:** ```js -let path = this.context.getApplicationContext().fileDirs + "test.jpg"; +let context = featureAbility.getContext(); +let path = context.getCacheDir() + "test.jpg"; const imageSourceApi = image.createImageSource(path); ``` @@ -2529,7 +2530,7 @@ PixelMap的初始化选项。 | 名称 | 类型 | 可读 | 可写 | 说明 | | ------- | ------ | ---- | ---- | --------------------------------------------------- | -| format | string | 是 | 是 | 目标格式。
当前支持格式有:.jpg .png .gif .bmp .webp RAW。 | +| format | string | 是 | 是 | 目标格式。
当前只支持jpg和webp。 | | quality | number | 是 | 是 | JPEG编码中设定输出图片质量的参数,取值范围为1-100。 | | bufferSize9+ | number | 是 | 是 | 用于设置图片大小,默认为10M | -- GitLab