> 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
```
...
...
@@ -11,24 +10,19 @@ import display from '@ohos.display';
```
## Required Permissions
None
## DisplayState
Provides the state of a display.
| Name| Default Value| Description|
| -------- | -------- | -------- |
| STATE_UNKNOWN | 0 | Unknown.|
| STATE_OFF | 1 | The display is shut down.|
| STATE_ON | 2 | The display is powered on.|
| STATE_DOZE | 3 | The display is in sleep mode.|
| STATE_DOZE_SUSPEND | 4 | The display is in sleep mode, and the CPU is suspended.|
| STATE_VR | 5 | The display is in VR mode.|
| STATE_ON_SUSPEND | 6 | The display is powered on, and the CPU is suspended.|
| STATE_OFF | 1 | The display is shut down.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| STATE_ON | 2 | The display is powered on.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| STATE_DOZE | 3 | The display is in sleep mode.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| STATE_DOZE_SUSPEND | 4 | The display is in sleep mode, and the CPU is suspended.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| STATE_VR | 5 | The display is in VR mode.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| STATE_ON_SUSPEND | 6 | The display is powered on, and the CPU is suspended.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
## Display
...
...
@@ -37,31 +31,33 @@ Describes the attributes of a display.
| alive | boolean | Yes| No| Whether the display is alive.|
| state | [DisplayState](#displaystate) | Yes| No| State of the display.|
| refreshRate | number | Yes| No| Refresh rate of the display.|
| rotation | number | Yes| No| Screen rotation angle of the display.|
| width | number | Yes| No| Width of the display, in pixels.|
| height | number | Yes| No| Height of the display, in pixels.|
| densityDPI | number | Yes| No| Screen density of the display, in DPI.|
| densityPixels | number | Yes| No| Screen density of the display, in pixels.|
| scaledDensity | number | Yes| No| Scaling factor for fonts displayed on the display.|
| xDPI | number | Yes| No| Exact physical dots per inch of the screen in the horizontal direction.|
| yDPI | number | Yes| No| Exact physical dots per inch of the screen in the vertical direction.|
| id | number | Yes| No| ID of the display.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| name | string | Yes| No| Name of the display.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| alive | boolean | Yes| No| Whether the display is alive.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| state | [DisplayState](#DisplayState) | Yes| No| State of the display. <br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| refreshRate | number | Yes| No| Refresh rate of the display.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| rotation | number | Yes| No| Screen rotation angle of the display.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| width | number | Yes| No| Width of the display, in pixels.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| height | number | Yes| No| Height of the display, in pixels.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| densityDPI | number | Yes| No| Screen density of the display, in DPI.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| densityPixels | number | Yes| No| Screen density of the display, in pixels.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| scaledDensity | number | Yes| No| Scaling factor for fonts displayed on the display.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| xDPI | number | Yes| No| Exact physical dots per inch of the screen in the horizontal direction.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|
| yDPI | number | Yes| No| Exact physical dots per inch of the screen in the vertical direction.<br/>**System capabilities**: SystemCapability.WindowManager.WindowManager.Core|