gpt4 book ai didi

python - win32 : get current DEVMODE of a monitor

转载 作者:太空宇宙 更新时间:2023-11-04 06:29:52 24 4
gpt4 key购买 nike

如何在 win32 中获取当前分辨率?我知道我可以使用 GetMonitorInfo 获取监视器的当前边界矩形,但我怎样才能同时获取位深度?差不多,我如何获得给定监视器的 DEVMODE 结构?

我使用的是 python 和 pywin32,因此专门解决这些问题的解决方案很好,但只需调用 winapi 即可。

最佳答案

除了 Dean 的回答中提到的 EnumDisplayMonitors 函数之外,您还需要 GetDeviceCaps() .请参阅参数 BITSPIXEL:它为您提供每个像素的相邻颜色位数。

关于python - win32 : get current DEVMODE of a monitor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4200560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com