Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 144dp bitmap resource on ImageView

I want to show a large bitmap in an ImageView (144dp), but I got bad quality. The bitmap is stored in my drawable resources.

Can I show the bitmap in full quality?

Xml layout:

<ImageView
    android:layout_width="144dp"
    android:layout_height="144dp"
    android:src="@drawable/ic_add"/>

What I want:

http://tinypic.com/r/2jv72w/8

http://tinypic.com/r/2r7mtz4/8

What I have:

http://tinypic.com/r/osh9qq/8

Look at the big images who show that the list is empty.

like image 203
User Avatar asked Feb 12 '23 07:02

User


1 Answers

replace your ic_add file in the following locations with a better bitmap version approximately sized to what 144dp represents for the android density buckets as follows:

folder (density buckets)       image dimensions
res/drawable-mdpi              144x144 px
res/drawable-hdpi              216x216 px
res/drawable-xhdpi             288x288 px
res/drawable-xxhdpi            432x432 px
res/drawable-xxxhdpi           576x576 px
like image 129
petey Avatar answered Feb 15 '23 10:02

petey