Open Android Camera in lower resolution with ACTIO

2020-02-11 05:57发布

I am opening android camera using intent like this :

    Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

    cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedImageURI);  
    startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

But camera always opens 6mp resolution (i think its devices max camera resolution) i want to open it lower resolution like 2mp. Is there anyway to do this

Thanks for any advice.

2条回答
相关推荐>>
2楼-- · 2020-02-11 06:12

Unfortunately there is no way you can do this. Once a different application is lauched the settings of that app can only be changed by the user using the application.

It would be disastrous to allow other apps to change the settings of an app.

So you have two options now -

  • Build you own camera activity and take pictures in the resolution that you want
  • Tell the user to take pictures only at the resolution that you specidy, basically ask the user to change the camera resolution to the one you want in the camera application before he takes a picture..
查看更多
冷血范
3楼-- · 2020-02-11 06:25

This option is available only for video capturing, using this lines

intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); // high quality
startActivityForResult()

For our disasapoitment "MediaStore" don`t have parameter for EXTRA_IMAGE_QUALITY

查看更多
登录 后发表回答