As a result, you can change the system DPI to whatever
you want, and WPF will adjust the size of your application seamlessly.
CHAPTER 1 n INTRODUCING WPF 8
nNote Depending on the system DPI, the calculated pixel size may be a fractional value. You might
assume that WPF simply rounds off your measurements to the nearest pixel. (In fact, WPF supports a pixelsnapping
feature that does exactly this, and you??™ll learn how to enable it for specific bits of content in
Chapter 13.) However, by default, WPF does something different. If an edge of an element falls between pixels,
it uses anti-aliasing to blend that edge into the adjacent pixels. This might seem like an odd choice, but
it actually makes a fair bit of sense. Your controls won??™t necessarily have straight, clearly defined edges if
you use custom-drawn graphics to skin them; so some level of anti-aliasing is already necessary.
The steps for adjusting the system DPI depend on the operating system. In Windows XP,
you follow these steps:
1. Right-click your desktop and choose Display.
2. Choose the Settings tab and click Advanced.
3. On the General tab, choose Normal Size (96 dpi), or Large Size (120 dpi). These are the
two recommended options for Windows XP, because custom DPI settings are less likely
to be supported by older programs.
Pages:
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89