DevMode、Videomodedescriptor:屏幕刷新率数据

DevMode、Videomodedescriptor:屏幕刷新率数据

dmDisplayFrequency开发模式似乎是垂直的{维基百科} 显示器的刷新率-这是否一定对应于VerticalRefreshRateNumerator/VerticalRefreshRateDenominator视频模式描述符四舍五入到最接近的整数?

否则,相对于最近制造的监视器,是否会HorizontalRefreshRate(Numerator,Denominator)在制定中发挥关键作用dmDisplayFrequency

答案1

是的,垂直刷新率是对应的,但需要四舍五入,因为dmDisplayFrequency值被读为无符号整数。以下 AHK 脚本显示四舍五入的值:

Enabled := ComObjError(1)
wmi := ComObjGet("winmgmts:{impersonationLevel=impersonate}!\\" A_ComputerName "\root\wmi")

for monitor in wmi.ExecQuery("SELECT NumOfMonitorSourceModes, MonitorSourceModes FROM WmiMonitorListedSupportedSourceModes WHERE Active=TRUE",,wbemFlagForwardOnly := 32)
{
Loop, % monitor.NumOfMonitorSourceModes - 1
modes .= "`n" . monitor.MonitorSourceModes[A_Index - 1].HorizontalActivePixels . " " . monitor.MonitorSourceModes[A_Index - 1].VerticalActivePixels . " Horz refresh: " . Round(monitor.MonitorSourceModes[A_Index - 1].HorizontalRefreshRateNumerator/monitor.MonitorSourceModes[A_Index - 1].HorizontalRefreshRateDenominator) . " Vert refresh: " . Round(monitor.MonitorSourceModes[A_Index - 1].VerticalRefreshRateNumerator/monitor.MonitorSourceModes[A_Index - 1].VerticalRefreshRateDenominator)
msgbox % monitor.InstanceName . "`n" . modes
}

重复的值集归因于隔行扫描或甚至可能是平移。对于此设置中连接的旧显示器和电视,水平速率要大得多,它们是否有特殊含义?在这里的一两种情况下,分子和相应的分母再次大得多,但再次产生 10 5
量级的结果。

相关内容