The following worked for me:
private Drawable resize(Drawable image) {
Bitmap b = ((BitmapDrawable)image).getBitmap();
Bitmap bitmapResized = Bitmap.createScaledBitmap(b, 50, 50, false);
return new BitmapDrawable(getResources(), bitmapResized);
}
More Related Contents:
- Resize a large bitmap file to scaled output file on Android
- Quality problems when resizing an image at runtime
- Strange OutOfMemory issue while loading an image to a Bitmap object
- Masking(crop) image in frame
- Android Drawable Images from URL
- Decrease image size without losing its quality in android
- High resolution Image – OutOfMemoryError
- Android take screen shot programmatically
- Drawable folders in res folder?
- Can Android’s WebView automatically resize huge images?
- Android: how to convert whole ImageView to Bitmap?
- Android saving Bitmap to SD card
- Android : Understanding drawable folder
- how to fill color in image in particular area?
- Using drawable resources
- Finding the dominant color of an image in an Android @drawable
- Convert String text to Bitmap
- Get the displayed size of an image inside an ImageView
- Android – how to get or set (print) DPI ( dots per inch ) of JPEG file while loading or saving it programmatically?
- How to resize a bitmap eficiently and with out losing quality in android
- Android SkImageDecoder::Factory returned null Error
- Is it possible to display inline images from html in an Android TextView?
- Android: how to make a clickable map image with each country producing a different action?
- How to cache bitmaps into native memory
- @Android display /res/viewable in WebView
- How to make an image fit into a circular frame in android
- Suggestions to avoid bitmap Out of Memory error
- Android Drawable: Specifying shape width in percent in the XML file?
- How do I change the tint of an ImageButton on focus/press
- Newer versions of Android Studio add only two drawable directories – drawable and drawable-v21