提交 fae904ef 编写于 作者: W wusongqing 提交者: gloria

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 2e5c5994
# Display # 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. > 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 ## Modules to Import
...@@ -58,13 +58,12 @@ Obtains the default display object. ...@@ -58,13 +58,12 @@ Obtains the default display object.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[Display](#display)&gt; | Yes| Callback used to return the default display object.| | callback | AsyncCallback&lt;[Display](#display)&gt; | Yes| Callback used to return the default display object.|
- Example **Example**
```js ```js
var displayClass = null; var displayClass = null;
display.getDefaultDisplay((err, data) => { display.getDefaultDisplay((err, data) => {
...@@ -85,13 +84,13 @@ Obtains the default display object. ...@@ -85,13 +84,13 @@ Obtains the default display object.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Return value **Return value**
| Type | Description | | Type | Description |
| ---------------------------------- | ---------------------------------------------- | | ---------------------------------- | ---------------------------------------------- |
| Promise&lt;[Display](#display)&gt; | Promise used to return the default display object.| | Promise&lt;[Display](#display)&gt; | Promise used to return the default display object.|
- Example **Example**
```js ```js
let promise = display.getDefaultDisplay(); let promise = display.getDefaultDisplay();
...@@ -110,13 +109,13 @@ Obtains all the display objects. ...@@ -110,13 +109,13 @@ Obtains all the display objects.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------- | ---- | ------------------------------- | | -------- | ---------------------------------------------------- | ---- | ------------------------------- |
| callback | AsyncCallback&lt;Array&lt;[Display](#display)&gt;&gt; | Yes | Callback used to return all the display objects.| | callback | AsyncCallback&lt;Array&lt;[Display](#display)&gt;&gt; | Yes | Callback used to return all the display objects.|
- Example **Example**
```js ```js
display.getAllDisplay((err, data) => { display.getAllDisplay((err, data) => {
...@@ -136,13 +135,13 @@ Obtains all the display objects. ...@@ -136,13 +135,13 @@ Obtains all the display objects.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Return value **Return value**
| Type | Description | | Type | Description |
| ----------------------------------------------- | ------------------------------------------------------- | | ----------------------------------------------- | ------------------------------------------------------- |
| Promise&lt;Array&lt;[Display](#display)&gt;&gt; | Promise used to return an array containing all the display objects.| | Promise&lt;Array&lt;[Display](#display)&gt;&gt; | Promise used to return an array containing all the display objects.|
- Example **Example**
```js ```js
let promise = display.getAllDisplay(); let promise = display.getAllDisplay();
...@@ -161,14 +160,13 @@ Enables listening. ...@@ -161,14 +160,13 @@ Enables listening.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | 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| | 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.| | callback | Callback&lt;number&gt; | Yes| Callback used to return the ID of the display.|
- Example **Example**
```js ```js
var type = "add"; var type = "add";
var callback = (data) => { var callback = (data) => {
...@@ -186,14 +184,13 @@ Disables listening. ...@@ -186,14 +184,13 @@ Disables listening.
**System capabilities**: SystemCapability.WindowManager.WindowManager.Core **System capabilities**: SystemCapability.WindowManager.WindowManager.Core
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | 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| | 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.| | callback | Callback&lt;number&gt; | No| Callback used to return the ID of the display.|
- Example **Example**
```js ```js
var type = "remove"; var type = "remove";
display.off(type); display.off(type);
......
# Screenshot # 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. > 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 ## Modules to Import
...@@ -58,14 +58,14 @@ Takes a screenshot and saves it as a **PixelMap** object. This method uses a cal ...@@ -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 **Required permissions**: ohos.permission.CAPTURE_SCREEN
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.| | 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. | | callback | AsyncCallback&lt;image.PixelMap&gt; | Yes | Callback used to return a **PixelMap** object. |
- Example **Example**
```js ```js
var ScreenshotOptions = { var ScreenshotOptions = {
...@@ -98,19 +98,19 @@ Takes a screenshot and saves it as a **PixelMap** object. This method uses a pro ...@@ -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 **Required permissions**: ohos.permission.CAPTURE_SCREEN
- Parameters **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ | | ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.| | 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 | | Type | Description |
| ----------------------------- | ----------------------------------------------- | | ----------------------------- | ----------------------------------------------- |
| Promise&lt;image.PixelMap&gt; | Promise used to return an **image.PixelMap** object.| | Promise&lt;image.PixelMap&gt; | Promise used to return an **image.PixelMap** object.|
- Example **Example**
```js ```js
var ScreenshotOptions = { var ScreenshotOptions = {
......
# webgl # 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. > 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 ...@@ -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: 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> <button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>
``` ```
Obtain the **<canvas\>** component instance in the JS file. The following is an example: Obtain the **<canvas\>** component instance in the JS file. The following is an example:
``` ```js
// Obtain the <canvas> component instance. // Obtain the <canvas> component instance.
const el = this.$refs.canvas1; const el = this.$refs.canvas1;
// Obtain the WebGL context from the <canvas> component instance. // Obtain the WebGL context from the <canvas> component instance.
......
# webgl2 # 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. > 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 ...@@ -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: 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> <button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>
``` ```
Obtain the **<canvas\>** component instance in the JS file. The following is an example: Obtain the **<canvas\>** component instance in the JS file. The following is an example:
``` ```js
// Obtain the <canvas> component instance. // Obtain the <canvas> component instance.
const el = this.$refs.canvas1; const el = this.$refs.canvas1;
// Obtain the WebGL context from the <canvas> component instance. // 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.
先完成此消息的编辑!
想要评论请 注册