Does the WPF unit really have nothing to do with resolution?

Source: Internet
Author: User

WPF has been the highlight of "resolution-independent (resolution Independence)" since its release, claiming that the user interface made using WPF is well displayed on the lightweight Ultra-Mobile PC screen and on a 50-inch TV. The reason why Microsoft calls WPF "Resolution-independent" is that WPF's coordinate units are designed to be 1/96 inches as a logical pixel unit, not a device-related pixel unit.

But Microsoft itself has no more specific explanation for the "Resolution-independent" feature of WPF, resulting in a lot of misunderstanding from users.

One of the misconceptions

Changing the resolution settings for the display will not change the user interface of the same WPF and the drawing dimensions.

This can be a very simple experiment to prove that the conclusion is wrong. Create a new WPF application window with a height of 400DIUs (diu:device Independent unit, device-independent units) and a width of 600DIUs, which allows the window to run in an environment where the resolution is set to 1280 * 1024 and 800*600. As shown in the following illustration, the size of the two windows is significantly different.

  

Figure 1 The left figure is 1280 * 1024 resolution, the right image is 800*600 resolution

Misunderstanding of the second

Changes the DPI settings displayed, and the user interface and drawing dimensions of the same WPF do not change.

The DPI settings that are displayed, in the XP system, are made by right-clicking--Properties--Settings tab--Advanced, which can be called out as shown in the following figure:

Figure 2 Displaying the property DPI setting

This can also be done in the same way to prove that the conclusion is wrong. It is still highly 400dius[1], with a width of 600DIUs windows running in 96DPI and 192DPI two settings respectively. It is also obvious from the following figure that the size of the window is different.

         

Figure 3 The left image is 96DPI, and the right image is 192DPI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.