Image Size (drawable-hdpi / ldpi / mdpi / xhdpi)

Learn android, now I have some images to put in drop down dirs (hdpi / ldpi / mdpi / xhdpi). I read a lot, but again I do not understand. What size should be the image for each directory?

+50
android
Jan 17 '13 at 15:06
source share
8 answers

Hope this helps ...

mdpi is the reference density, i.e. 1 px on the mdpi display is equal to 1 dip. Value for asset scaling:

ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi 0.75 | 1 | 1.5 | 2 | 3 | 4 

Although you don’t need to worry about tvdpi unless you are developing specifically for Google TV or the original Nexus 7, even Google recommends simply using hdpi assets. You probably also don't need to worry about xxhdpi (although it never hurts, and at least the launch icon should be represented in xxhdpi), and xxxhdpi is just a constant in the source code right now (no devices use it, and do not. I expect some time, if ever), so you can also ignore it.

This means that if you are making a 48dip image and plan to support up to xhdpi resolution, you must start with an image of 96 pixels (144 pixels if you want to use your own resources for xxhdpi) and make the following images for density:

 ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi 36 x 36 | 48 x 48 | 72 x 72 | 96 x 96 | 144 x 144 | 192 x 192 

And they should be displayed at approximately the same level on any device, provided that you have placed them in density folders (e.g. drawable-xhdpi, drawable-hdpi, etc.).

For reference, the pixel density for them:

 ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi 120 | 160 | 240 | 320 | 480 | 640 
+115
Feb 25 '14 at 8:49
source share
 MDPI - 32px HDPI - 48px XHDPI- 64px 

This Cheat Sheet may come in handy. check the image :-)

image

+28
Feb 23 '14 at 17:52
source share

I already have a full explanation here

In principle, general guidelines for image design:

 ldpi is 0.75x dimensions of mdpi hdpi is 1.5x dimensions of mdpi xhdpi is 2x dimensinons of mdpi 

Usually, I draw mdpi images for a 320x480 screen, and then multiply the sizes according to the rules above to get images for other resolutions.

Please refer to the full explanation for a more detailed answer.

+13
Jan 17 '13 at 15:09
source share

See the image for reference: - (Soruce: - Android Studio - “Object Properties” parameter and Android Office Site )

enter image description here

+4
Sep 22 '16 at 18:12
source share

low dpi - 0.75x dpi medium sizes

high dpi is 1.5x dpi dpi dimension

ultra-high dpi is 2x dpi dimensions

It’s good practice to create all the images in vector format so that you can easily modify them using vector design software such as Illustrator , etc.

+3
Sep 29 '13 at 20:28
source share

The tablets support tvdpi, and for this the scaling factor is 1.33 times. DPI Dimensions

  ldpi | mdpi | tvdpi | hdpi | xhdpi | xxhdpi | xxxhdpi 0.75 | 1 | 1.33 | 1.5 | 2 | 3 | 4 

This means that if you are creating a 400x400 image for xxxhdpi devices, you must create the same resource at 300x300 for xxhdpi, 200x200 for xhdpi, 133x133 for tvdpi, 150x150 for hdpi, 100x100 for mdpi and 75x75 for ldpi devices.

+3
Nov 18 '15 at 8:56
source share

you can use Android Asset in android studio, and the Android resource will provide you with an image of this size in the form of a picture, and the application will automatically use the size based on the device’s screen or emulate

0
Sep 22 '16 at 18:17
source share

Not only the tab icons, notification and launch launches the application. I was confused by the size of the other icons used for different situations in the application.

I am using 32px mdpi (action bar icons) and I can’t tell if that was correct.

mdpi 32px

0
Mar 04 '17 at 5:09 on
source share



All Articles