TpDisplay 类
V0.2.1TpExtUtils
2025-11-14
基础信息
| 头文件: | include <TpDisplay.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 类型
struct TpDisplay::TpDisplayModeParam
| 类型 | 名称 | 描述 |
|---|---|---|
| tpUInt16 | width | |
| tpUInt16 | height | |
| float | refresh |
enum TpDisplay::TpRotate
| 名称 | 值 | 描述 |
|---|---|---|
| TpRotate_0 | 0 | |
| TpRotate_90 | 90 | |
| TpRotate_180 | 180 | |
| TpRotate_270 | 270 |
Public 成员函数
| TpDisplay() | ||
|---|---|---|
| TpDisplay(tpInt32 screen) | ||
| TpDisplay(TpString &name) | ||
| ~TpDisplay() | ||
| TpList< TpDisplayModeParam > | getDisplayMode() | 获取显示器显示模式 |
| TpString | getName() | 获取当前显示器的名字 |
| getPhysicsHeight() | 获取物理尺寸的高度 | |
| getPhysicsWidth() | 获取物理尺寸的宽度 | |
| getPiXWMPhysicsHeight() | 获取PiXWM物理尺寸高度 | |
| getPiXWMPhysicsWidth() | 获取PiXWM物理尺寸宽度 | |
| getResolutionHeight() | 获取当前显示器分辨率高度 | |
| getResolutionWidth() | 获取当前显示器分辨率宽度 | |
| setResolution(tpUInt32 width, tpUInt32 height) | 设置分辨率(只能设置支持的分辨率,否则会失败) | |
| setLight(tpUInt8 light) | 设置亮度(暂不支持) | |
| getLight() | 获取屏幕亮度(暂不支持) | |
| dp2Px(const uint32_t &_dp, const int32_t &_screenNum=-1) | 将DP值根据当前显示器分辨率转换为像素值(px) | |
| sp2Px(const uint32_t &_sp, const int32_t &_screenNum=-1) | 将SP值根据当前显示器分辨率转换为像素值(px) | |
| getPiXWMResolutionWidth() | 获取PiXWM的分辨率的宽度 | |
| getPiXWMResolutionHeight() | 获取PiXWM的分辨率的宽度 |
成员函数说明
TpDisplay::TpDisplay()
暂无注释...
TpDisplay::TpDisplay(tpInt32 screen)
暂无注释...
TpDisplay::TpDisplay(TpString &name)
暂无注释...
TpDisplay::~TpDisplay()
暂无注释...
TpList< TpDisplayModeParam > TpDisplay::getDisplayMode()
获取显示器显示模式...
获取显示器显示模式
返回值:显示模式列表
TpString TpDisplay::getName()
获取当前显示器的名字...
获取当前显示器的名字
返回值:显示器名称
tpInt32 TpDisplay::getPhysicsHeight()
获取物理尺寸的高度...
获取物理尺寸的高度
返回值:返回单位mm
tpInt32 TpDisplay::getPhysicsWidth()
获取物理尺寸的宽度...
获取物理尺寸的宽度
返回值:返回单位mm
tpInt32 TpDisplay::getPiXWMPhysicsHeight()
获取PiXWM物理尺寸高度...
获取PiXWM物理尺寸高度
返回值:返回单位mm
tpInt32 TpDisplay::getPiXWMPhysicsWidth()
获取PiXWM物理尺寸宽度...
获取PiXWM物理尺寸宽度
返回值:返回单位mm
tpInt32 TpDisplay::getResolutionHeight()
获取当前显示器分辨率高度...
获取当前显示器分辨率高度
返回值:分辨率像素高度
tpInt32 TpDisplay::getResolutionWidth()
获取当前显示器分辨率宽度...
获取当前显示器分辨率宽度
返回值:分辨率像素宽度
tpInt32 TpDisplay::setResolution(tpUInt32 width, tpUInt32 height)
设置分辨率(只能设置支持的分辨率,否则会失败)...
设置分辨率(只能设置支持的分辨率,否则会失败)
参数:width: 像素宽度
参数:height: 像素高度
返回值:成功返回0,失败返回-1
tpInt32 TpDisplay::setLight(tpUInt8 light)
设置亮度(暂不支持)...
设置亮度(暂不支持)
参数:light:
返回值:
tpInt32 TpDisplay::getLight()
获取屏幕亮度(暂不支持)...
获取屏幕亮度(暂不支持)
返回值:
static uint32_t TpDisplay::dp2Px(const uint32_t &_dp, const int32_t &_screenNum=-1)
将DP值根据当前显示器分辨率转换为像素值(px)...
将DP值根据当前显示器分辨率转换为像素值(px)
参数:_dp: dp值
参数:_screenNum: 屏幕编号,给入则使用指定屏幕编号,否则则使用程序当前显示的屏幕
返回值:转换后的px值
static uint32_t TpDisplay::sp2Px(const uint32_t &_sp, const int32_t &_screenNum=-1)
将SP值根据当前显示器分辨率转换为像素值(px)...
将SP值根据当前显示器分辨率转换为像素值(px)
参数:_sp: sp值
参数:_screenNum: 屏幕编号,给入则使用指定屏幕编号,否则则使用程序当前显示的屏幕
返回值:转换后的px值
static tpInt32 TpDisplay::getPiXWMResolutionWidth()
获取PiXWM的分辨率的宽度...
获取PiXWM的分辨率的宽度
返回值:成功返回宽度,失败返回-1;
static tpInt32 TpDisplay::getPiXWMResolutionHeight()
获取PiXWM的分辨率的宽度...
获取PiXWM的分辨率的宽度
返回值:成功返回宽度,失败返回-1;
