问题
We have a Python-based application with a WxPython GUI that we create for multiple operating systems. In Windows 10, at least in my environment (inside a VM on a high resolution monitor), the text elements in the interface are blurry. I can improve the appearance by setting the Windows application DPI-scaling override. However, the only way I have found so far is to do it manually from the Windows file explorer interface.
My question: Is there a way to set this property from the command line, so that I can script this as part of building our application?
回答1:
in python code:
ctypes.windll.shcore.SetProcessDpiAwareness(1)
https://docs.microsoft.com/en-us/windows/desktop/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness
来源:https://stackoverflow.com/questions/50884217/how-can-i-set-windows-dpi-scaling-overrides-via-a-script