Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Android Camera in lower resolution with ACTION_IMAGE_CAPTURE

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.

like image 744
cagryInside Avatar asked Oct 27 '11 08:10

cagryInside


People also ask

How do you open camera through intent and display captured image?

Intent camera_intent = new Intent(MediaStore. ACTION_IMAGE_CAPTURE); startActivityForResult(camera_intent, pic_id); Now use the onActivityResult() method to get the result, here is the captured image.


2 Answers

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..
like image 131
bluefalcon Avatar answered Sep 20 '22 17:09

bluefalcon


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

like image 20
Vasil Valchev Avatar answered Sep 20 '22 17:09

Vasil Valchev