android taking picture by MediaStore.ACTION_IMAGE_

2019-08-30 00:49发布

问题:

Is is possible to pass via Intent target image size to camera when using MediaStore.ACTION_IMAGE_CAPTURE Intent and starting activity with this intent? Or do I have to manually resize the taken photo image?

回答1:

There is only one extra parameter with this intent which is extra_output (where the image will be stored) as compared to the video_capture intent which has size, quality etc. So not possible.

On the other hand you can use the camera class instead to capture the photo which gives you much greater control over camera and its settings but requires more work to implement. There is a good tutorial about its use on the android developer website.