amitairos
amitairos

Reputation: 2967

Android image size confusion

I'm very confused about making drawables for Android.
Let's say I want to make a big image that will fill 30% of the screen, or a certain amount of dp, like 300dp.
What size should that image be in pixels for each screen density, and in what dpi should I save it in?

Upvotes: 1

Views: 402

Answers (2)

surya
surya

Reputation: 607

https://developer.android.com/guide/practices/screens_support.html

ldpi - 0.75 * mdpi , mdpi - 1 * mdpi , hdpi - 1.5 * mdpi , xhdpi - 2 * mdpi , xxhdpi - 3 * mdpi , xxxhdpi - 4 * hdpi ,

so if you want to generate for mdpi screen to be 300dp the image should be resized according to the above calculation

Upvotes: 1

fernandospr
fernandospr

Reputation: 3061

For 300dp, you need:

300px for mdpi (1x)

450px for hdpi (1.5x)

600px for xhdpi (2x)

900px for xxhdpi (3x)

1200px for xxxhdpi (4x)

Upvotes: 2

Related Questions