Created
April 10, 2013 15:28
-
-
Save finleyChen/5355634 to your computer and use it in GitHub Desktop.
This file contains 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
private void cropImage() { | |
// Use existing crop activity. | |
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(mImageCaptureUri, IMAGE_UNSPECIFIED); | |
// Specify image size | |
intent.putExtra("outputX", 100); | |
intent.putExtra("outputY", 100); | |
// Specify aspect ratio, 1:1 | |
intent.putExtra("aspectX", 1); | |
intent.putExtra("aspectY", 1); | |
intent.putExtra("scale", true); | |
intent.putExtra("return-data", true); | |
// REQUEST_CODE_CROP_PHOTO is an integer tag you defined to | |
// identify the activity in onActivityResult() when it returns | |
startActivityForResult(intent, REQUEST_CODE_CROP_PHOTO); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment