查到了SetProcessDpiAwareness這個函式的三個引數
PROCESS_DPI_UNAWARE DPI unaware. This app does not scale for DPI changes and is always assumed to have a scale factor of 100% (96 DPI). It will be automatically scaled by the system on any other DPI setting.
這個我以為會DWM會幫我放大,發現不行。
PROCESS_SYSTEM_DPI_AWARE System DPI aware. This app does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the app. If the DPI changes, the app will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system value.
這個是應用啟動階段獲取dpi,但是dpi改變后不會通知到軟體。總的來說還是靠軟體自己解決。
PROCESS_PER_MONITOR_DPI_AWARE Per monitor DPI aware. This app checks for the DPI when it is created and adjusts the scale factor whenever the DPI changes. These applications are not automatically scaled by the system.
dpi改變后會通知到軟體,但是需要軟體自己解決。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/267966.html
標籤:界面
