java.lang.Object
|---ohos.agp.window.service.DisplayAttributes
public class DisplayAttributes
extends Object
以像素为单位封装显示属性,包括显示宽度、高度和密度。
Since:
3
| 修饰符和类型 | 字段 | 描述 |
|---|---|---|
| int | densityDpi | 表示显示分辨率。 |
| float | densityPixels | 以像素为单位表示显示密度。 |
| int | height | 表示显示的实际高度,以像素为单位。 |
| static int | HIGH_DENSITY | 表示高分辨率显示的密度,值为 240。 |
| static int | LOW_DENSITY | 表示低分辨率显示的密度,值为 120。 |
| static int | MEDIUM_DENSITY | 表示中分辨率显示的密度,值为 160。 |
| float | scalDensity | 指示显示的文本比例密度。 |
| int | width | 表示显示的实际宽度,以像素为单位。 |
| float | xDpi | 表示 X 轴上的每英寸点数 (DPI)。 |
| float | yDpi | 表示 Y 轴上的 DPI。 |
| 构造函数 | 描述 |
|---|---|
| DisplayAttributes() | 用于创建 DisplayAttributes 实例的默认构造函数。 |
| 从类 java.lang.Object 继承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
public static final int HIGH_DENSITY
表示高分辨率显示的密度,值为 240。
public static final int LOW_DENSITY
表示低分辨率显示的密度,值为 120。
public static final int MEDIUM_DENSITY
表示中分辨率显示的密度,值为 160。
public int densityDpi
表示显示分辨率。
public float densityPixels
以像素为单位表示显示密度。 低分辨率显示器的值为 1.0。
public int height
表示显示的实际高度,以像素为单位。
public float scalDensity
指示显示的文本比例密度。
public int width
表示显示的实际宽度,以像素为单位。
public float xDpi
表示 X 轴上的每英寸点数 (DPI)。
public float yDpi
表示 Y 轴上的 DPI。
public DisplayAttributes()
用于创建 DisplayAttributes 实例的默认构造函数。
备案信息: 粤ICP备15087711号-2
Copyright © 2008-2025 啊嘎哇在线工具箱 All Rights.
本站所有资料来源于网络,版权归原作者所有,仅作学习交流使用,如不慎侵犯了您的权利,请联系我们。