On Android, what is the visual effect of displayi开发者_如何学Pythonng a very high DPI image on a screen with low DPI?
What about a very low DPI image on a high DPI screen?
A high dpi image will just be bigger on the lower DPI screen. Conversely, a low dpi image will be smaller on a high dpi screen.
That's simplifying it a bit. It also depends on whether scaling is enabled. If you only have an hdpi image in your resources, and you're viewing it on an ldpi screen, depending on your settings, Android may scale it downward, in which case you'll have a slightly reduced quality image, that should display around the same size. The other way around (ldpi on hdpi with scaling), you'll have a noticeably pixelated image on your hdpi screen, scaled to the same size.
The dpi really isn't important; what's important is the actual physical size of the image. If you have more pixels squeezed into an inch of display (higher pixel density; hdpi), you'll need a larger image to take up an inch of space on the screen than you would for a low density screen. The benefit of a higher density screen is that you can fit more detail into a specific area. That's why on different devices -- for example, the Droid vs the Droid Eris -- reading text at small sizes is noticeably more difficult on the Eris due to its low density.
If you display a low DPI image on a high DPI screen it will appear smaller than it would on a low DPI screen.
- High DPI image on low DPI display: the image will look bigger unless there is some kind of scaling.
- Low DPI image on high DPI display: the image will look smaller or less detailed if displayed "as is". Often it will look blurry/pixelized because of scaling.
It's easy to launch emulators to see what happens for yourself.
A HDPI image on a LDPI screen would appear larger than the same image on a MDPI or HDPI screen.
A LDPI image on a HDPI screen would appear smaller than the same image on a MDPI or LDPI screen.
(Oof. Beat by 2 min, 1 min, and 15 sec.)
精彩评论