android - Using the formula px = dp * (dpi/160) for creating image resources does not result in sharp images -
although question not related programming, related app development.
suppose have imageview dimensions 40dp*40dp. if use above formula create icon device screen density 217 ppi, size of icon fits imageview 55px*55px. if use icon in view in consideration, result icon not appear sharp.
on other hand, if use larger image of size, 80px*80px, appears sharp. larger image larger fitting 1 factor of 1.6.
what know whether there value of above factor efficient , conventional. follow conventions while developing apps.
thanks time.
your imageview
size 40dp, thats equal to:
- 40 x 1.0 = 40 pixel on mdpi devices
- 40 x 1.5 = 60 pixel on hdpi devices
- 40 x 2.0 = 80 pixel on xhdpi devices
- 40 x 3.0 = 120 pixel on xxhdpi devices
- 40 x 4.0 = 160 pixel on xxxhdpi devices
now device hdpi
(217). thats device need 60x60 pixel bitmap, , have put in drawable-hdpi
directory.
using drawable
directory using drawable-mdpi
directory. fro each resource in directory android scale up/down before using it.
Comments
Post a Comment