I am using the following sample code, https://github.com/mklimek/android-crop/tree/newfeature_fied_size_crop. It is giving the fixed size cropping view(i.e., HighlightView). But the problem is this highlightView is fixed depends on Uploaded image. Below are the screen shots with two different size uploaded images.
I used below lines of code to fix the size of the HighlightView:
private void beginCrop(Uri source) {
Uri outputUri = Uri.fromFile(new File(getCacheDir(), "cropped"));
new Crop(source).output(outputUri).asRectangle().withFixedSize(100, 210).start(this);
}
withFixedSize() method is used to fix the size of the cropped area , we cannot resize that view if we use this method, that is fine. But That cropped area should be fixed with width=100, height=210,It should not change depends the uploaded image.
Big size uploaded image has a small size of crop view (i.e., HighlightView):
Small size uploaded image has a large size of crop view (i.e., HighlightView):
My requirement is I have to fix the size of cropped area, I should not resize that. I searched in google world. But I didn't found solution.
Please help me on this.
visit this : https://github.com/jdamcd/android-crop
Crop
Listen for the result of the crop (see example project if you want to do some error handling):
Some attributes are provided to customise the crop screen. See the example project theme.
Pick
The library provides a utility method to start an image picker:
Dependency
The AAR is published on Maven Central:
Java code :
Output :