I want to crop an image in my application when it is selected from gallery. i.e if I launch the gallery and select an image the cropping window should come like when we sele
You can already tell the Camera/Gallery-Intent to start the crop-editor after the image is selected/taken:
Intent pickImageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
pickImageIntent.setType("image/*");
pickImageIntent.putExtra("crop", "true");
pickImageIntent.putExtra("outputX", 200);
pickImageIntent.putExtra("outputY", 200);
pickImageIntent.putExtra("aspectX", 1);
pickImageIntent.putExtra("aspectY", 1);
pickImageIntent.putExtra("scale", true);
pickImageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriWhereToStore);
pickImageIntent.putExtra("outputFormat",
Bitmap.CompressFormat.JPEG.toString());
startActivityForResult(pickImageIntent, RESULT_LOAD_IMAGE);
Intent takePicIntent = new Intent("android.media.action.IMAGE_CAPTURE");
takePicIntent .putExtra("crop", "true");
takePicIntent .putExtra("outputX", 200);
takePicIntent .putExtra("outputY", 200);
takePicIntent .putExtra("aspectX", 1);
takePicIntent .putExtra("aspectY", 1);
takePicIntent .putExtra("scale", true);
takePicIntent .putExtra(MediaStore.EXTRA_OUTPUT, uriWhereToStore);
takePicIntent .putExtra("outputFormat",
Bitmap.CompressFormat.JPEG.toString());
startActivityForResult(takePicIntent , RESULT_LOAD_IMAGE);