i use this method to resize the bitmap who is larger than 100 kb but its
make it so small and lose alot of quality
private Bitmap decodeBitmapFile(File f){
try {
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeStream(new FileInputStream(f),null,o);
final int REQUIRED_SIZE=120;
int scale=1;
while(o.outWidth/scale/2>=REQUIRED_SIZE &&
o.outHeight/scale/2>=REQUIRED_SIZE)
scale*=2;
BitmapFactory.Options o2 = new BitmapFactory.Options();
o2.inSampleSize=scale;
return BitmapFactory.decodeStream(new FileInputStream(f), null,
o2);
} catch (FileNotFoundException e) {}
return null;
}
so it is there any other way to resize the bitmap to be around the 100
kb
thx for help
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en