After I do an image capture intent or gallery pick intent, I receive the selected image. This image I want to resize to certain sizes the selected image and get it as new File in order to send it to server. Is possible to achieve this thing ?? Is there any library that can give you such feature ?
Asked
Active
Viewed 60 times
0
-
by size what do you mean? resolution.. height and width? – Gaurang Jul 20 '16 at 07:33
-
1Possible duplicate of [How to resize an image i picked from the gallery in android?](http://stackoverflow.com/questions/10773511/how-to-resize-an-image-i-picked-from-the-gallery-in-android) – Harshad Pansuriya Jul 20 '16 at 07:34
-
you use compress method..... without lossing – Arjun saini Jul 20 '16 at 08:17
1 Answers
2
you can use Picasso.
Picasso
.with(context)
.load(UsageExampleListViewAdapter.eatFoodyImages[0])
.resize(600, 200) // resizes the image to these dimensions (in pixel). does not respect aspect ratio
.into(imageViewResize);
and if you want the file after resize you can work with target
.into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
// send bitmap to server
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
}
});
onBitmapLoaded give you bitmap and this what you need to send to server

Yoni
- 1,346
- 3
- 16
- 38