Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a2ba95e6
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看板
未验证
提交
a2ba95e6
编写于
11月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!11038 翻译完成:10212+10709+10772+10978+10989+9885+11065 窗口子系统模块文档更新
Merge pull request !11038 from wusongqing/TR10212
上级
d49f0237
7f47ffb6
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
4987 addition
and
1819 deletion
+4987
-1819
en/application-dev/reference/apis/js-apis-display.md
en/application-dev/reference/apis/js-apis-display.md
+251
-101
en/application-dev/reference/apis/js-apis-screen.md
en/application-dev/reference/apis/js-apis-screen.md
+455
-162
en/application-dev/reference/apis/js-apis-screenshot.md
en/application-dev/reference/apis/js-apis-screenshot.md
+37
-25
en/application-dev/reference/apis/js-apis-window.md
en/application-dev/reference/apis/js-apis-window.md
+4122
-1531
en/application-dev/reference/errorcodes/errorcode-display.md
en/application-dev/reference/errorcodes/errorcode-display.md
+43
-0
en/application-dev/reference/errorcodes/errorcode-window.md
en/application-dev/reference/errorcodes/errorcode-window.md
+79
-0
未找到文件。
en/application-dev/reference/apis/js-apis-display.md
浏览文件 @
a2ba95e6
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-screen.md
浏览文件 @
a2ba95e6
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-screenshot.md
浏览文件 @
a2ba95e6
...
...
@@ -73,7 +73,7 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses an async
**Example**
```
js
var
screenshotOptions
=
{
let
screenshotOptions
=
{
"
screenRect
"
:
{
"
left
"
:
200
,
"
top
"
:
100
,
...
...
@@ -85,14 +85,18 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses an async
"
rotation
"
:
0
,
"
displayId
"
:
0
};
try
{
screenshot
.
save
(
screenshotOptions
,
(
err
,
pixelMap
)
=>
{
if
(
err
)
{
console
.
log
(
'
Failed to save screenshot
:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
Failed to save screenshot. Code
:
'
+
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.
});
}
catch
(
exception
)
{
console
.
error
(
'
Failed to save screenshot. Code:
'
+
JSON
.
stringify
(
exception
));
};
```
## screenshot.save
...
...
@@ -114,14 +118,18 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses an async
**Example**
```
js
try
{
screenshot
.
save
((
err
,
pixelMap
)
=>
{
if
(
err
)
{
console
.
log
(
'
Failed to save screenshot
:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
Failed to save screenshot. Code
:
'
+
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.
});
}
catch
(
exception
)
{
console
.
error
(
'
Failed to save screenshot. Code:
'
+
JSON
.
stringify
(
exception
));
};
```
## screenshot.save
...
...
@@ -149,7 +157,7 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses a promis
**Example**
```
js
var
screenshotOptions
=
{
let
screenshotOptions
=
{
"
screenRect
"
:
{
"
left
"
:
200
,
"
top
"
:
100
,
...
...
@@ -161,11 +169,15 @@ Takes a screenshot and saves it as a **PixelMap** object. This API uses a promis
"
rotation
"
:
0
,
"
displayId
"
:
0
};
try
{
let
promise
=
screenshot
.
save
(
screenshotOptions
);
promise
.
then
((
pixelMap
)
=>
{
console
.
log
(
'
Succeeded in saving sreenshot. Pixel bytes number:
'
+
pixelMap
.
getPixelBytesNumber
());
pixelMap
.
release
();
// Release the memory in time after the PixelMap is used.
}).
catch
((
err
)
=>
{
console
.
log
(
'
Failed to save screenshot
:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
Failed to save screenshot. Code
:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
exception
)
{
console
.
error
(
'
Failed to save screenshot. Code:
'
+
JSON
.
stringify
(
exception
));
};
```
en/application-dev/reference/apis/js-apis-window.md
浏览文件 @
a2ba95e6
此差异已折叠。
点击以展开。
en/application-dev/reference/errorcodes/errorcode-display.md
0 → 100644
浏览文件 @
a2ba95e6
# Display Error Codes
## 1400001 Invalid Display or Screen
**Error Message**
Invalid display or screen.
**Description**
This error code is reported when an invalid display, including a virtual screen, is operated.
**Possible Causes**
1.
The virtual screen has not been created.
2.
The virtual screen has been destroyed.
**Procedure**
1.
Before operating the virtual screen, check whether the virtual screen has been created.
2.
Check whether the virtual screen has been destroyed.
## 1400002 Unauthorized Operation
**Error Message**
Unauthorized operation.
**Description**
This error code is reported when the API does not have the required permissions to operate an object.
**Possible Causes**
The virtual screen object of another process is operated.
**Procedure**
Check whether unauthorized operations are performed on the object of another process. If yes, delete the operations.
## 1400003 Abnormal Display Manager Service
**Error Message**
This display manager service works abnormally.
**Description**
This error code is reported when the display manager service is abnormal.
**Possible Causes**
1.
The display manager service is not started normally.
2.
The bottom-layer graphics synthesis and rendering are abnormal.
**Procedure**
Try again later or restart the device.
en/application-dev/reference/errorcodes/errorcode-window.md
0 → 100644
浏览文件 @
a2ba95e6
# Window Error Codes
## 1300001 Repeated Operation
**Error Message**
Repeated operation.
**Description**
This error code is reported when a repeated operation is performed.
**Possible Causes**
The window to create already exists.
**Procedure**
Before creating a window, check whether the window already exists. If it already exists, use it directly.
## 1300002 Abnormal Window State
**Error Message**
This window state is abnormal.
**Description**
This error code is reported when you operate a window in an abnormal state, for example, a window that has been destroyed.
**Possible Causes**
The window has been destroyed when being operated.
**Procedure**
Before operating the window, check whether it exists.
## 1300003 Abnormal Window Manager Service
**Error Message**
This window manager service works abnormally.
**Description**
This error code is reported when the window manager service is abnormal.
**Possible Causes**
The internal services of the window are not started normally.
**Procedure**
Try again later or restart the device.
## 1300004 Unauthorized Operation
**Error Message**
Unauthorized operation.
**Description**
This error code is reported when the API does not have the required permissions to operate an object.
**Possible Causes**
The window object of another process is operated.
**Procedure**
Check whether unauthorized operations are performed on the object of another process. If yes, delete the operations.
## 1300005 Abnormal Window Stage
**Error Message**
This window stage is abnormal.
**Description**
This error code is reported when you operate a window stage in the abnormal state, for example, a window stage that has been destroyed.
**Possible Causes**
The window stage has been destroyed when being operated.
**Procedure**
Before operating a window stage, check whether it exists.
## 1300006 Abnormal Window Context
**Error Message**
This window context is abnormal.
**Description**
This error code is reported when you operate a window context in the abnormal state, for example, a window context that has been destroyed.
**Possible Causes**
The window context has been destroyed when being operated.
**Procedure**
Before operating the window context, check whether it exists.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录