Android小技巧/获取图片的大小


FileInputStream fis;
fis = new FileInputStream(imagePath);
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inJustDecodeBounds = true;
//opt.outWidth; 
//opt.outHeight;
BitmapFactory.decodeFile(imagePath,opt);
Bitmap bitmap = BitmapFactory.decodeStream(fis,null, opt);


你可能感兴趣的:(Android小技巧/获取图片的大小)