Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Button Image size in android

Tags:

android

I have put image as background of button. but I don't know at what size of images should I create in Photoshop for all three folders drawable-hdpi,drawable-ldpi, and drawable-mdpi?

Thank you.

like image 522
user861973 Avatar asked Mar 14 '12 07:03

user861973


2 Answers

If your buttom image is Plain-colored background and if it can be a Stretchable image then Create a bitmap using 9-Patch Tool.

Otherwise, read about Alternate Drawables section on Android developer site:

To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8 scaling ratio between the four generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon), all the different sizes should be:

36x36 for low-density

48x48 for medium-density

72x72 for high-density

96x96 for extra high-density

like image 153
Paresh Mayani Avatar answered Sep 16 '22 23:09

Paresh Mayani


I think this can help you, is a conversion tool, adding image size (mdpi), it gives me the result in pixels for each screen sizes.

http://labs.rampinteractive.co.uk/android_dp_px_calculator/

Hope it helps!

like image 36
sandee Avatar answered Sep 19 '22 23:09

sandee