1. Are you ready for the Galaxy S20? Here is everything we know so far!

Why does an image appear blurry on a hdpi screen when it has been alloted the max possible pixels

Discussion in 'Android Development' started by Devang Shah, Aug 13, 2020.

  1. Devang Shah

    Devang Shah Lurker
    Thread Starter

    I want to put a 40 X 40 DP icon somewhere on my app's screen. Now according to the ratio (3:4:6:8:12:16) of 6 different logical buckets, I have provided an icon(.png file) with different sizes in 6 different drawable folders.

    In my case, the icon sizes must be "MDPI = 40 X 40 PX, HDPI = 60 X 60 PX, XHDPI = 80 X 80 PX and so on" to maintain the same quality across devices at 40 X 40 DP.

    After doing so, I'm testing the app on a device with an HDPI screen, which means it should look into the "drawable-HDPI" folder and render an image that basically fills up all the pixels (60 px in a space that has 60px(based on the screen)). But somehow, the icon appears blurry.

    What went wrong here !?

    Meanwhile, I tried putting an icon with much higher pixels(512 x 512 PX) in the HDPI folder and it renders with high quality.

    The only confusion is - Despite filling out all the pixels contained in 40 DP on an HDPI display, how an image with more pixels(512) has better quality?
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Why does image
  1. JimmyPixel3a
    Replies:
    21
    Views:
    1,367
  2. AppleUser
    Replies:
    2
    Views:
    1,350
  3. malumaluu019
    Replies:
    2
    Views:
    630
  4. sargan
    Replies:
    9
    Views:
    932
  5. Dreflydre
    Replies:
    7
    Views:
    1,179
  6. OM2
    Replies:
    2
    Views:
    778
  7. Usalabs
    Replies:
    6
    Views:
    803
  8. chris096
    Replies:
    7
    Views:
    3,902
  9. NewDroidGA
    Replies:
    0
    Views:
    1,678
  10. cavecityy
    Replies:
    1
    Views:
    1,133

Share This Page

Loading...