DPI perception of different versions of the application of different versions
Some applications may unexpected DPI perception changes may occur between different versions. This difference may be attributed to external factors, such as changes in the use of third -party components or development environments.
In the specific case mentioned in the text, although the DPI perception is not clearly set in the application list, and the Windows API related to DPI is not directly called, the application becomes DPI perception in the subsequent version. This is likely to contain a DPI perception third -party component, which introduces DPI perception into the application.In order to solve this problem, the following solutions can be considered:
Expressing DPI perception
In Visual Studio 2015-upd.1 or higher versions, by canceling the comments of the part and set it to False to declare DPI perception in the application list.
add attributes to the assemblyinfo.cs file to disable the automatic DPI perception of the external component referenced by the WPF program set.
Other precautions[assembly: System.Windows.Media.DisableDpiAwareness]
If the dpi perception causes the interface problem, consider redesigning the application to explicitly process DPI scaling, or use a thread -based SetThreadPiawarenessContext function to zoom in specific components while maintaining the remaining components.
See Microsoft's documentation to learn more about DPI perception:
The above is the detailed content of Why Did My Application Suddenly Become DPI-Aware Across Different Releases?. For more information, please follow other related articles on the PHP Chinese website!