我只是找到com.android.camera.action.CROP.Can的那些值。我为height
指定了width
和com.android.camera.action.CROP
?
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("outputX", 480);
intent.putExtra("outputY", 480);
intent.putExtra("scale", true);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
intent.putExtra("return-data", false);
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("noFaceDetection", false); // no face detection
startActivityForResult(intent, requestCode);
答案 0 :(得分:0)
我建议您查看以下链接:
http://code.tutsplus.com/tutorials/capture-and-crop-an-image-with-the-device-camera--mobile-11458
如果您想要更改高度和宽度,请更改以下代码中的值并查看结果:
intent.putExtra("outputX", 480);
intent.putExtra("outputY", 480);
并查看宽高比