java - How are PNG files defined as drawable objects resized based on the resolution of the Android phone? -
i have png file 32x32 pixels. use 8 of these drawables in row app. these drawables not in hdpi, mdpi, or ldpi folders. i’ve found when starting of 3 standard size emulators, screen view 8 drawables looks pretty same.
i note ldpi emulator i’m using (qvga) has resolution of 240x320. 8 x 32 = 256, since can see drawables (and space in-between) i’m betting changing size.
i’ve read supporting multiple screens document @ android developers page, still don’t understand happening. put own words explain happening size of drawables , how sdk knows automatically modify them?
of course - system automatically resizes images drawable directory correspond dpi of device if don't define own. in fact 'drawable' directory pretty same 'drawable-mdpi' directory, , because don't have ldpi , hdpi versions defined system automatically builds them out of mdpi resources. see (1.) here: http://developer.android.com/guide/practices/screens_support.html#support - "pre-scaling of resources (such image assets)"
of course icons somehow ok on ldpi devices ugly on hdpi devices. that's because mdpi icons scaled match higher dimensions, resulting in less information per pixel.
Comments
Post a Comment