I use this code to get started with the crop, and I get the cropped image as data in the onActivityResult back. So it works great.
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setType("image/*");
List<ResolveInfo> list = getPackageManager().queryIntentActivities(
intent, 0);
int size = list.size();
if (size == 0) {
Toast.makeText(this, "Can not find image crop app",
Toast.LENGTH_SHORT).show();
return;
} else {
intent.setData(mImageCaptureUri);
intent.putExtra("outputX", 200);
intent.putExtra("outputY", 200);
intent.putExtra("scale", true);
intent.putExtra("return-data", true);
Intent i = new Intent(intent);
ResolveInfo res = list.get(0);
i.setComponent(new ComponentName(res.activityInfo.packageName,
res.activityInfo.name));
startActivityForResult(i, CROP_FROM_CAMERA);
This is a code for cropping an image of size 200x200, it does not matter what aspect ratio I chose when working with cropping. It bothers me that I want the aspect ratio that I select with a rectangle in activity, rather than a fixed one, putting the numbers 200 and 200.
But when I comment on these two lines, my program will force to close ...
- , , , , ?
? !