how to reduce large image size to thumbnail size in android

筅森魡賤 提交于 2019-11-28 08:47:49
Rohit Mandiwal

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/

DynamicMind

Add the following elements in your xml file then you get your answer.

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

I hope this is helpful to you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!