问题
I am developing app where i want to crop image taken from camera and upload to sftp server. I am using following code to crop image:
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inSampleSize = 1;
Bitmap bm = BitmapFactory.decodeFile(imagePath, opts);
Intent intent = new Intent("com.android.camera.action.CROP");
intent .setDataAndType(outputFileUri, "image/*");
intent.putExtra("outputX",bm.getWidth());
intent.putExtra("outputY", bm.getHeight());
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("scale", true);
intent.putExtra("return-data", false);
startActivityForResult(intent, 2);
With this I am getting a resizable rectangle. But while resizing cropped area width and height are changing proprtionally like this .

I want to change width and height of cropped area independently like in PhotoCrop app

I hope you have understand my problem.
EDIT: ****Also image cropping is not working on Samsung galaxy S3 and another thing is that when i resize cropping area, it is zooming the image too much and image is getting blur..****
回答1:
Try This :
intent.putExtra("aspectX", 0);
intent.putExtra("aspectY", 0);
Hope it helps you.
Thanks.
来源:https://stackoverflow.com/questions/13873994/android-crop-image-taken-from-camera-with-resizable-independant-height-and-wi