Created
August 7, 2013 05:06
-
-
Save kernelhcy/6171353 to your computer and use it in GitHub Desktop.
Android中剪裁图片
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
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(Uri.fromFile(capturePicFile), "image/*"); | |
//如何选择 | |
intent.putExtra("aspectX", 1); | |
intent.putExtra("aspectY", 1); | |
//输出大小 | |
intent.putExtra("outputX", 96); | |
intent.putExtra("outputY", 96); | |
intent.putExtra("noFaceDetection", true); | |
intent.putExtra("crop", "true"); | |
//intent.putExtra("return-data", true); //直接返回图片 | |
//保存到本地 | |
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(capturePicFile)); | |
startActivityForResult(intent, GET_IMAGE_FROM_LOCAL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment