Exercise 2: Run the Application at the 96 and 144 DPI SettingsIn this exercise, you will run the application at the 96 DPI setting and 144 DPI setting, and then compare the UI elements in each. Task 1 - Run the Application at the 144 DPI Setting
Figure 3
The demo running at 96 DPI Task 2 - Disable DPI Awareness of the Application
Task 3 - Run the Application with DPI Awareness Disabled in the 144 DPI Setting
Figure 5
The demo running at 144 DPI (with DPI awareness disabled)
Note:
Help:
Notice that you may need to clean the solution and then rebuild the solution in Visual Studio 2010 in order to see the update after you disable or enable the DPI awareness flag in the project properties.
Task 4 - Compare Demo with DPI Awareness Disabled in the 144 DPI Setting with the 96 DPI Setting
Note:
Help:
Notice that the application is blurry. This is because the application is incompatible with the default scaling offered by DPI virtualization.
With DPI set to 144, the operating system automatically enables DPI virtualization. When your application relies solely on DPI virtualization to scale its UI elements (e.g. it is not DPI aware), it might produce visual artifacts due to potential incompatibility with the DPI scaling.
Task 5 - Change Back to DPI Awareness and Run the Application in the 144 DPI Setting
Note:
Help:
Notice that the application is NOT blurry. This is because the application has declared DPI awareness and thus Windows disabled DPI virtualization to avoid producing visual artifacts due to potential incompatibility with the DPI scaling. The font is larger and clear, as expected. MFC automatically scales the Ribbon controls when the application declares DPI awareness.
Task 6 - Compare Demo with DPI Awareness Disabled at the 144 DPI setting with the 96 DPI setting
Figure 7
Comparison of non-DPI aware application (top) and DPI-aware application (bottom) |
Contents
|