Closed rafalzawadzki closed 9 years ago
If you want, you can create scaled up bitmap after getCroppedIamge.
Bitmap cropBitmap = ImageCropView.getCroppedIamge();
int width = cropBitmap.getWidth();
int height = cropBitmap.getHeight();
int newWidth = 300;
int newHeight = 300;
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
Bitmap resizeBitmap = Bitmap.createBitmap(cropBitmap, 0, 0, width, height, matrix, false);
When bitmap size is greater than view's dimensions, the returned bitmap is cropped correctly. If ImageCropView has bitmap with size smaller than view's size, the bitmap is scaled up to fit view dimensions, but .getCroppedImage() method returns the unscaled bitmap.
Is there any way to return the bitmap with size as seen in the ImageCropView?