jayrambhia / CropperNoCropper

Instagram Style Image Cropper for Android (Library)
http://www.jayrambhia.com/project/nocropper-library
Apache License 2.0
475 stars 99 forks source link

getCroppedBitmap returns BitmapResult and not a Bitmap #38

Closed mehrikhan closed 6 years ago

mehrikhan commented 6 years ago

Hi dear,

I was utilizing your great library "nocropper" for some of my need, i was working with the library on one of my PC where i get the Bitmap using getCroppedBitmap as " Bitmap bm = cropperView.getCroppedBitmap()", it went find and i got the resultant bitmap. But now i am working with the same library and code on my other PC where i get a weird error saying getCroppedBitmap returns BitmapResult so you have to get a BitmapResult and not a Bitmap. While i need a Bitmap so i can use it frther but I'm unable to get it. what could be the issue. can you please throw some light on it.

jayrambhia commented 6 years ago

Yes, the API definition has changed and now it returns BitmapResult.

BitmapResult result = cropper.getCroppedBitmap()
if (result.getState() == CropState.SUCCESS) {
  Bitmap bitmap = result.getBitmap();
}