Search code examples
androidxamarinandroid-imageviewandroid-imagedpi

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?


Solution

  • 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)