Handling Different Resolutions
In the section titled Scaling Images earlier in this chapter, you learned how to scale an image to fit the display area. That solution used the ClipRectangle property of the PaintEventArgs object to determine the size of the area being repainted, and so works well on a standard 176 x 220 pixel smartphone display and also on a 240 x 320 pixel QVGA display.
However, the code shown previously in the section titled Drawing Images, Text, and Shapes is not optimized for different resolutions. The pen width of 4 and font size of 10 display well on the standard smartphone (as shown in Figure 12-3), but the text looks a little bit small when displayed on the QVGA device. That is because the QVGA device displays text and
Get Microsoft® Mobile Development Handbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.