Create Same Size Image Across Various Android Densities

533 views Asked by At

My goal is to create 6 images of different densities that are the same size across the 6 generalized Android screen densities.

From reading Android's documentation on supporting multiple screen sizes I understand the dpi unit (dots per inch) really represents physical pixels per inch.

In my understanding, this means an image that is 160 pixels by 320 pixels on a 160 dpi screen will show up the same as an image that is 640 pixels by 1280 pixels on a 640 dpi screen. And both images will appear to be about 1 inch by 2 inches on their respective screen configurations. Is my understanding correct here?

1

There are 1 answers

1
frost On BEST ANSWER

You have to add images of various dimensions in various drawable folder viz- drawable-ldpi,drawable-mdpi and so on. And the image dimension ratio will be: Taking mdpi as a base your ldpi will be 0.75 times of mdpi hdpi - 1.5 times of mdpi xhdpi - 2 times of mdpi xxhdpi - 3 times of mdpi as mentioned in the link http://developer.android.com/guide/practices/screens_support.html#overview under alternative drawable section