Anup Shah on WPF and Silverlight (Programming Garden)

IT 's For You!!!

Thursday, March 15, 2012

Q: What unit of measurement is used by WPF?

All absolute measurements, such as the numbers used in this section’s size-related properties,
are specified in device-independent pixels. These “logical pixels” are meant to represent
1/96th of an inch, regardless of the screen’s DPI setting. Note that device-independent
pixels are always specified as double values, so they can be fractional.
The exact measurement of 1/96th of an inch isn’t important, although it was chosen
because on a typical 96 DPI display, one device-independent pixel is identical to one physical
pixel. Of course, the notion of a true “inch” depends on the physical display device. If an
application draws a one-inch line on my laptop screen, that line will certainly be longer than
one inch if I hook up my laptop to a projector!

No comments:

Post a Comment