As a result, if you create a button
that??™s 1 inch wide on your computer monitor, it can remain 1 inch wide on a high-resolution
monitor??”WPF will simply render it in greater detail and with more pixels.
nNote Resolution independence also has advantages when printing the contents of a window, as you??™ll
see in Chapter 20.
This is the big picture, but it glosses over a few details. Most importantly, you need to realize
that WPF bases its scaling on the system DPI setting, not the DPI of your physical display
device. This makes perfect sense??”after all, if you??™re displaying your application on a 100-inch
projector, you??™re probably standing several feet back and expecting to see a jumbo-size
CHAPTER 1 n INTRODUCING WPF 6
version of your windows. You don??™t want WPF to suddenly scale down your application to
???normal??? size. Similarly, if you??™re using a laptop with a high-resolution display, you probably
expect to have slightly smaller windows??”it??™s the price you pay to fit all your information onto
a smaller screen. Furthermore, different users have different preferences. Some want richer
detail, while others prefer to cram in more content.
So how does WPF determine how big an application window should be? The short answer
is that WPF uses the system DPI setting when it calculates sizes.
Pages:
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85