user6752231
user6752231

Reputation:

Another bitmap's sizes

I added bitmap image to drawable folder with 64x64 sizes. Then I get a reference to this by Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.brick); The problem is in output I get an image with 128x128 sizes. I dont use any BitmapFactory.Options. Why it happens?

Upvotes: 0

Views: 39

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007584

I added bitmap image to drawable folder with 64x64 sizes

I am going to assume that you mean this literally, and you put the images in res/drawable/. That is a synonym for res/drawable-mdpi/.

The problem is in output I get an image with 128x128 sizes.

That would occur if your device is an -xhdpi device. Android will resample the drawable from -mdpi (~160dpi) to -xhdpi (~320dpi).

Try moving your image to res/drawable-nodpi/.

Upvotes: 3

Related Questions