Bitmap缩略图

public static Bitmap pathToBitmap(String path ,int inSampleSize)
{
BitmapFactory.Options options =new BitmapFactory.Options();
// true 不加载图片到内存,知获取bitmap 的 宽 高
options.inJustDecodeBounds=true;
//加载 获取图片属性
BitmapFactory.decodeFile(path,options);
options.inSampleSize=inSampleSize;

//返回缩略的bitmap 到内存
options.inJustDecodeBounds=false;
Bitmap bitmap=BitmapFactory.decodeFile(path, options);
return bitmap;

}

其中inSimpleSize为 要缩略的倍数

你可能感兴趣的:(android,bitmap)