未验证 提交 b55ab284 编写于 作者: O openharmony_ci 提交者: Gitee

!3995 翻译完成:3913:API样板化相关修改:需同步翻译

Merge pull request !3995 from wusongqing/TR3913
# Display
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......@@ -58,13 +58,12 @@ Obtains the default display object.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[Display](#display)&gt; | Yes| Callback used to return the default display object.|
- Example
**Example**
```js
var displayClass = null;
display.getDefaultDisplay((err, data) => {
......@@ -85,13 +84,13 @@ Obtains the default display object.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ---------------------------------- | ---------------------------------------------- |
| Promise&lt;[Display](#display)&gt; | Promise used to return the default display object.|
- Example
**Example**
```js
let promise = display.getDefaultDisplay();
......@@ -110,13 +109,13 @@ Obtains all the display objects.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------- | ---- | ------------------------------- |
| callback | AsyncCallback&lt;Array&lt;[Display](#display)&gt;&gt; | Yes | Callback used to return all the display objects.|
- Example
**Example**
```js
display.getAllDisplay((err, data) => {
......@@ -136,13 +135,13 @@ Obtains all the display objects.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ----------------------------------------------- | ------------------------------------------------------- |
| Promise&lt;Array&lt;[Display](#display)&gt;&gt; | Promise used to return an array containing all the display objects.|
- Example
**Example**
```js
let promise = display.getAllDisplay();
......@@ -161,14 +160,13 @@ Enables listening.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Listening type. The available values are as follows:<br>-&nbsp;**add**: listening for whether a display is added<br>-&nbsp;**remove**: listening for whether a display is removed<br>-&nbsp;**change**: listening for whether a display is changed|
| callback | Callback&lt;number&gt; | Yes| Callback used to return the ID of the display.|
- Example
**Example**
```js
var type = "add";
var callback = (data) => {
......@@ -186,14 +184,13 @@ Disables listening.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Listening type. The available values are as follows:<br>-&nbsp;**add**: listening for whether a display is added<br>-&nbsp;**remove**: listening for whether a display is removed<br>-&nbsp;**change**: listening for whether a display is changed|
| callback | Callback&lt;number&gt; | No| Callback used to return the ID of the display.|
- Example
**Example**
```js
var type = "remove";
display.off(type);
......
# Screenshot
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......@@ -58,14 +58,14 @@ Takes a screenshot and saves it as a **PixelMap** object. This method uses a cal
**Required permissions**: ohos.permission.CAPTURE_SCREEN
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.|
| callback | AsyncCallback&lt;image.PixelMap&gt; | Yes | Callback used to return a **PixelMap** object. |
- Example
**Example**
```js
var ScreenshotOptions = {
......@@ -98,19 +98,19 @@ Takes a screenshot and saves it as a **PixelMap** object. This method uses a pro
**Required permissions**: ohos.permission.CAPTURE_SCREEN
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.|
- Return value
**Return value**
| Type | Description |
| ----------------------------- | ----------------------------------------------- |
| Promise&lt;image.PixelMap&gt; | Promise used to return an **image.PixelMap** object.|
- Example
**Example**
```js
var ScreenshotOptions = {
......
# webgl
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -11,18 +11,18 @@ This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set
Create a **<canvas\>** component in the HML file. The following is an example:
```
<div class="container">
<canvas ref="canvas1" style="width : 400px; height : 200px; background-color : lightyellow;"></canvas>
<button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>
```
Obtain the **<canvas\>** component instance in the JS file. The following is an example:
```
```js
// Obtain the <canvas> component instance.
const el = this.$refs.canvas1;
// Obtain the WebGL context from the <canvas> component instance.
......
# webgl2
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -11,18 +11,18 @@ This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set
Create a **<canvas\>** component in the HML file. The following is an example:
```
<div class="container">
<canvas ref="canvas1" style="width : 400px; height : 200px; background-color : lightyellow;"></canvas>
<button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>
```
Obtain the **<canvas\>** component instance in the JS file. The following is an example:
```
```js
// Obtain the <canvas> component instance.
const el = this.$refs.canvas1;
// Obtain the WebGL context from the <canvas> component instance.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册