根据我的经验,你不能通过为这个意图提供参数来设置图像的大小。
如果你会添加这样的东西
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,location_of_image_to_save);
,它会返回相机设置的默认尺寸图片。稍后您可以使用此代码更改图像的大小
int width = photo.getWidth();
int height = photo.getHeight();
int newWidth =3000;
int newHeight =3000;
float scaleWidth = ((float) newWidth) / width;// calculate the scale - in this case = 0.4f
float scaleHeight = ((float) newHeight) / height;
// createa matrix for the manipulation
Matrix matrix = new Matrix();
// resize the bit map
matrix.postScale(scaleWidth, scaleHeight);
// rotate the Bitmap
// recreate the new Bitmap
Bitmap.createBitmap(photo, 0, 0,width, height, matrix, true);
Bitmap resizedBitmap = Bitmap.createBitmap(photo, 0, 0, 1000, 1000);