Created
March 11, 2015 08:13
-
-
Save mustafasevgi/04f4a62b055007e0ee46 to your computer and use it in GitHub Desktop.
Android crop intent parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent photoPickerIntent = new Intent( | |
Intent.ACTION_PICK, | |
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); | |
photoPickerIntent.setType("image/*"); | |
photoPickerIntent.putExtra("crop", "true"); | |
photoPickerIntent.putExtra("outputX", 150); | |
photoPickerIntent.putExtra("outputY", 150); | |
photoPickerIntent.putExtra("aspectX", 1); | |
photoPickerIntent.putExtra("aspectY", 1); | |
photoPickerIntent.putExtra("scale", true); | |
photoPickerIntent.putExtra("crop", "true"); | |
photoPickerIntent.putExtra("scaleUpIfNeeded", true);//learn it from gallery2 source code | |
photoPickerIntent.putExtra("max-width", 300); | |
photoPickerIntent.putExtra("max-height", 300); | |
photoPickerIntent.putExtra(MediaStore.EXTRA_OUTPUT, getTempUri()); | |
photoPickerIntent.putExtra("outputFormat", | |
Bitmap.CompressFormat.JPEG.toString()); | |
startActivityForResult(photoPickerIntent, RESULT_LOAD_IMAGE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great Example