Skip to content Skip to sidebar Skip to footer

How To Reduce Large Image Size To Thumbnail Size In Android

in my app, i have large images, i display it in an image view by hard code the size as 60 X 60 dp. how to reduce the image size as image thumb nail size in android. is there progra

Solution 1:

Most simple way is

int h = 48; // height in pixels
int w = 48; // width in pixels    
Bitmap scaled = Bitmap.createScaledBitmap(largeBitmap, h, w, true);

and detailed This is called the image scaling

This will help you http://zerocredibility.wordpress.com/2011/01/27/android-bitmap-scaling/


Solution 2:

Add the following elements in your xml file:

android:scaleType="fitXY"
android:layout_width="48dip" 
android:layout_height="48dip"

Post a Comment for "How To Reduce Large Image Size To Thumbnail Size In Android"