Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
966a1f94
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
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看板
提交
966a1f94
编写于
8月 17, 2023
作者:
L
lixia7819
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:lixia7819/docs
上级
fbbbf366
3b3a177a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
172 deletion
+12
-172
en/application-dev/reference/apis/js-apis-window.md
en/application-dev/reference/apis/js-apis-window.md
+0
-119
en/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
en/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
+0
-4
zh-cn/application-dev/reference/apis/js-apis-window.md
zh-cn/application-dev/reference/apis/js-apis-window.md
+12
-45
zh-cn/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
zh-cn/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
+0
-4
未找到文件。
en/application-dev/reference/apis/js-apis-window.md
浏览文件 @
966a1f94
...
@@ -1074,125 +1074,6 @@ try {
...
@@ -1074,125 +1074,6 @@ try {
}
}
```
```
## window.setWaterMarkImage<sup>10+</sup>
setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback
<
void
>
): void
Show or don't show watermark image. This API uses an asynchronous callback to return the result.
**System API**
: This is a system API.
**System capability**
: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------- |
| pixelMap |
[
image.PixelMap
](
js-apis-image.md#pixelmap7
)
| Yes | Watermark image.|
| enable | boolean | Yes | Whether to show watermark image. The value
**true**
means to show watermark image, and
**false**
means the opposite.|
| callback | AsyncCallback
<
void
>
| Yes | Callback used to return the result.|
**Error codes**
For details about the error codes, see
[
Window Error Codes
](
../errorcodes/errorcode-window.md
)
.
| ID| Error Message|
| ------- | --------------------------------------------- |
| 1300003 | This window manager service works abnormally. |
**Example**
```
js
import
image
from
'
@ohos.multimedia.image
'
;
let
pixelMap
;
let
color
=
new
ArrayBuffer
(
0
);
let
initializationOptions
=
{
size
:
{
height
:
100
,
width
:
100
}
};
image
.
createPixelMap
(
color
,
initializationOptions
)
.
then
((
pixelMap
)
=>
{
console
.
info
(
'
Succeeded in creating a pixelmap.
'
);
try
{
window
.
setWaterMarkImage
(
pixelMap
,
true
,
(
err
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in showing watermark image.
'
);
});
}
catch
(
exception
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
}
}).
catch
((
err
)
=>
{
console
.
error
(
`createPixelMap failed. Cause: `
+
JSON
.
stringify
(
err
));
});
```
## window.setWaterMarkImage<sup>10+</sup>
setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise
<
void
>
Show or don't show watermark image. This API uses a promise to return the result.
**System API**
: This is a system API.
**System capability**
: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------- |
| pixelMap |
[
image.PixelMap
](
js-apis-image.md#pixelmap7
)
| Yes | Watermark image.|
| enable | boolean | Yes | Whether to show watermark image. The value
**true**
means to show watermark image, and
**false**
means the opposite.|
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise
<
void
>
| Promise that returns no value.|
**Error codes**
For details about the error codes, see
[
Window Error Codes
](
../errorcodes/errorcode-window.md
)
.
| ID| Error Message|
| ------- | -------------------------------------------- |
| 1300003 | This window manager service works abnormally. |
**Example**
```
js
import
image
from
'
@ohos.multimedia.image
'
;
let
pixelMap
;
let
color
=
new
ArrayBuffer
(
0
);
let
initializationOptions
=
{
size
:
{
height
:
100
,
width
:
100
}
};
image
.
createPixelMap
(
color
,
initializationOptions
)
.
then
((
pixelMap
)
=>
{
console
.
info
(
'
Succeeded in creating a pixelmap.
'
);
try
{
let
promise
=
window
.
setWaterMarkImage
(
pixelMap
,
true
,
(
err
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in showing watermark image.
'
);
});
}
catch
(
exception
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
}
}).
catch
((
err
)
=>
{
console
.
error
(
`createPixelMap failed. Cause: `
+
JSON
.
stringify
(
err
));
});
```
## window.create<sup>(deprecated)</sup>
## window.create<sup>(deprecated)</sup>
create(id: string, type: WindowType, callback: AsyncCallback
<
Window
>
): void
create(id: string, type: WindowType, callback: AsyncCallback
<
Window
>
): void
...
...
en/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
浏览文件 @
966a1f94
...
@@ -22,12 +22,8 @@
...
@@ -22,12 +22,8 @@
|Added|NA|Module name: ohos.screen
<br>
Class name: Screen
<br>
Method or attribute name: readonly sourceMode: ScreenSourceMode;|@ohos.screen.d.ts|
|Added|NA|Module name: ohos.screen
<br>
Class name: Screen
<br>
Method or attribute name: readonly sourceMode: ScreenSourceMode;|@ohos.screen.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setGestureNavigationEnabled(enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setGestureNavigationEnabled(enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function on(type: 'gestureNavigationEnabledChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function on(type: 'gestureNavigationEnabledChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function off(type: 'gestureNavigationEnabledChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function off(type: 'gestureNavigationEnabledChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function on(type: 'waterMarkFlagChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Class name: window
<br>
Method or attribute name: function off(type: 'waterMarkFlagChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|Added|NA|Module name: ohos.window
<br>
Class name: WindowEventType|@ohos.window.d.ts|
|Added|NA|Module name: ohos.window
<br>
Class name: WindowEventType|@ohos.window.d.ts|
|Added|NA|Class name: WindowEventType
<br>
Method or attribute name: |@ohos.window.d.ts|
|Added|NA|Class name: WindowEventType
<br>
Method or attribute name: |@ohos.window.d.ts|
|Added|NA|Module name: ohos.window
<br>
Class name: WindowEventType
<br>
Method or attribute name: WINDOW_SHOWN = 1|@ohos.window.d.ts|
|Added|NA|Module name: ohos.window
<br>
Class name: WindowEventType
<br>
Method or attribute name: WINDOW_SHOWN = 1|@ohos.window.d.ts|
...
...
zh-cn/application-dev/reference/apis/js-apis-window.md
浏览文件 @
966a1f94
...
@@ -1102,33 +1102,17 @@ setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCall
...
@@ -1102,33 +1102,17 @@ setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCall
**示例:**
**示例:**
```
js
```
js
import
image
from
'
@ohos.multimedia.image
'
;
try
{
window
.
setWaterMarkImage
(
pixelMap
,
true
,
(
err
)
=>
{
let
pixelMap
;
if
(
err
.
code
)
{
let
color
=
new
ArrayBuffer
(
0
);
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
let
initializationOptions
=
{
return
;
size
:
{
height
:
100
,
width
:
100
}
};
image
.
createPixelMap
(
color
,
initializationOptions
)
.
then
((
pixelMap
)
=>
{
console
.
info
(
'
Succeeded in creating a pixelmap.
'
);
try
{
window
.
setWaterMarkImage
(
pixelMap
,
true
,
(
err
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
}
console
.
info
(
'
Succeeded in showing watermark image.
'
);
console
.
info
(
'
Succeeded in showing watermark image.
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
}
}
}).
catch
((
err
)
=>
{
console
.
error
(
`createPixelMap failed. Cause: `
+
JSON
.
stringify
(
err
));
});
```
```
## window.setWaterMarkImage<sup>10+</sup>
## window.setWaterMarkImage<sup>10+</sup>
...
@@ -1164,33 +1148,16 @@ setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise<void>
...
@@ -1164,33 +1148,16 @@ setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise<void>
**示例:**
**示例:**
```
js
```
js
import
image
from
'
@ohos.multimedia.image
'
;
try
{
let
promise
=
window
.
setWaterMarkImage
(
pixelMap
,
true
);
let
pixelMap
;
promise
.
then
(()
=>
{
let
color
=
new
ArrayBuffer
(
0
);
let
initializationOptions
=
{
size
:
{
height
:
100
,
width
:
100
}
};
image
.
createPixelMap
(
color
,
initializationOptions
)
.
then
((
pixelMap
)
=>
{
console
.
info
(
'
Succeeded in creating a pixelmap.
'
);
try
{
let
promise
=
window
.
setWaterMarkImage
(
pixelMap
,
true
,
(
err
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in showing watermark image.
'
);
console
.
info
(
'
Succeeded in showing watermark image.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to show watermark image. Cause:
'
+
JSON
.
stringify
(
exception
));
}
}
}).
catch
((
err
)
=>
{
console
.
error
(
`createPixelMap failed. Cause: `
+
JSON
.
stringify
(
err
));
});
```
```
## window.create<sup>(deprecated)</sup>
## window.create<sup>(deprecated)</sup>
...
...
zh-cn/release-notes/api-diff/v4.0-beta1/js-apidiff-window.md
浏览文件 @
966a1f94
...
@@ -22,12 +22,8 @@
...
@@ -22,12 +22,8 @@
|新增|NA|模块名: ohos.screen
<br>
类名: Screen
<br>
方法 or 属性:readonly sourceMode: ScreenSourceMode;|@ohos.screen.d.ts|
|新增|NA|模块名: ohos.screen
<br>
类名: Screen
<br>
方法 or 属性:readonly sourceMode: ScreenSourceMode;|@ohos.screen.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setGestureNavigationEnabled(enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setGestureNavigationEnabled(enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean, callback: AsyncCallback
\<
void>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function setWaterMarkImage(pixelMap: image.PixelMap, enable: boolean): Promise
\<
void>;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function on(type: 'gestureNavigationEnabledChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function on(type: 'gestureNavigationEnabledChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function off(type: 'gestureNavigationEnabledChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function off(type: 'gestureNavigationEnabledChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function on(type: 'waterMarkFlagChange', callback: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|类名:window
<br>
方法or属性:function off(type: 'waterMarkFlagChange', callback?: Callback
\<
boolean>): void;|@ohos.window.d.ts|
|新增|NA|模块名: ohos.window
<br>
类名: WindowEventType|@ohos.window.d.ts|
|新增|NA|模块名: ohos.window
<br>
类名: WindowEventType|@ohos.window.d.ts|
|新增|NA|类名:WindowEventType
<br>
方法or属性:|@ohos.window.d.ts|
|新增|NA|类名:WindowEventType
<br>
方法or属性:|@ohos.window.d.ts|
|新增|NA|模块名: ohos.window
<br>
类名: WindowEventType
<br>
方法 or 属性:WINDOW_SHOWN = 1|@ohos.window.d.ts|
|新增|NA|模块名: ohos.window
<br>
类名: WindowEventType
<br>
方法 or 属性:WINDOW_SHOWN = 1|@ohos.window.d.ts|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录