Ayub
Ayub

Reputation: 2375

What is the logic behind Android device scaling ratio (3:4:6:8:12:16)?

According to android developer reference:

follow the 3:4:6:8:12:16 scaling ratio between the six generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:

  • 36x36 (0.75x) for low-density

  • 48x48 (1.0x baseline) for medium-density

  • 72x72 (1.5x) for high-density

...

Why is it 0.75x and not 0.95x?

What is the logic behind these numbers?

Upvotes: 1

Views: 338

Answers (1)

PCésar
PCésar

Reputation: 11

As I understand it, there are four densities: ldpi, mdpi, hdpi and xhdpi (4). Take the size of your drawable bitmap, 48 in that case, then divide by 4, then use those numbers as multipliers: 3: 4: 6: 8: 12: 16 and you will have the resolution in each density.

48 / 4 = 12 * 3 = 36 ( 36 = 0,75% of 48 )

That's what I understood. Good luck.

Upvotes: 1

Related Questions