Issue
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?
Solution
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/
.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.