Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
301570e4
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
301570e4
编写于
2月 24, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15092 翻译完成:13788 fix image rotate_callback demo
Merge pull request !15092 from wusongqing/TR13788
上级
ac243d80
80468ef5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
6 deletion
+13
-6
en/application-dev/reference/apis/js-apis-image.md
en/application-dev/reference/apis/js-apis-image.md
+13
-6
未找到文件。
en/application-dev/reference/apis/js-apis-image.md
浏览文件 @
301570e4
...
...
@@ -736,9 +736,15 @@ Rotates this image based on the input angle. This API uses an asynchronous callb
**Example**
```
js
async
function
Demo
()
{
await
pixelmap
.
rotate
(
90.0
);
}
var
angle
=
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>
...
...
@@ -942,7 +948,8 @@ Creates an **ImageSource** instance based on the URI.
**Example**
```
js
let
path
=
this
.
context
.
getApplicationContext
().
fileDirs
+
"
test.jpg
"
;
let
context
=
featureAbility
.
getContext
();
let
path
=
context
.
getCacheDir
()
+
"
test.jpg
"
;
const
imageSourceApi
=
image
.
createImageSource
(
path
);
```
...
...
@@ -2039,7 +2046,7 @@ Creates an **ImageCreator** instance by specifying the image width, height, form
| 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**
...
...
@@ -2524,7 +2531,7 @@ Defines the option for image packing.
| 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.|
| 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录