The WPF form and all internal elements are measured by device-independent units. A device irrelevant unit is defined as one of 96 points of 1 inch, that is, 1/96 inch.
Suppose we have created a WPF button in 96X96 units. If standard Windows DPI settings (96 dpi) are used ), the size of each unit is a physical pixel in the real world. The calculation formula is as follows:
Physical unit size = device independent unit size x system DPI = 1/96 inch x 96 dpi = 1 pixel
For a 20 inch-inch display with a standard resolution of 1600x1200, its screen DPI is:
(1600 ^ 2 + 1200 ^ 2) ^ 0.5/20 = 100
On such a display, a 96X96 button is smaller than 1 inch. Similarly, the DPI of 15 inch LCD display is about 85, and the buttons mentioned above are larger than 1 inch.
Now, if we set the system DPI to 120 dpi, a device-independent unit of the WPF rendering engine is equal to 1.25 pixels (1/96 inch x 120 dpi ), the actual size of a 96X96 button is 120x120 pixels.
Here we see the so-called "fractional" pixel. a drawing point may fall between two pixels of the monitor. At this time, WPF will introduce the antialias mechanism ).