Developing DPI Aware Applications
As display technology improves, it is becoming possible to fit more pixels into the same area. This additional resolution can be used to fit more items on the screen, or it can be used to draw the same items sharply. When used for this latter application, the display is said to have increased in dots per inch (DPI), a logical value representing how densely packed with pixels a display area is.
Print media has taken advantage of high DPI technology for a long time. A document printed on a 1200-dpi printer prints the same amount of text as a 300-dpi printer, but the text is much sharper.
Windows Mobile-based Pocket PCs and Smartphones have traditionally used 96-DPI displays, but in the future they will run at higher DPI resolutions. Upgrading your application to support DPI awareness will not only ensure correct appearance on high-DPI devices, but will also prepare your application for these high-DPI advantages:
- Sharper text – The most noticeable improvement that comes with almost no cost. Every application that is DPI aware and uses TrueType fonts inherits this improvement.
- More detailed graphics – If steps are taken to provide high-resolution bitmaps, applications can use the increased resolution to display more detailed icons and graphics.
The following list shows the key issues to focus on when developing applications to determine the DPI of a device and take advantage of high-DPI displays:
- Layout
- Text and fonts
- Images
A header file, DeviceResolutionAware.h, provides a series of functions that can be used to correctly display text, graphics and images on a variety of resolutions.
See Also
High DPI Display | User Interface Layout | DPI Aware Text and Fonts | High DPI Images | High Resolution Legacy Support
Send Feedback on this topic to the authors