5

i am developing an image editing app, when the camera is invoked i can able to change the picture size as 16:9 manually, is it possible to open the camera by setting the picture size as 16:9 programatically.

the code below invokes the camera

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION|Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
startActivityForResult(intent, REQUEST_CAMERA);
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Aravindh Kumar
  • 1,213
  • 11
  • 22
  • Related: https://stackoverflow.com/questions/15438085/set-camera-size-parameters-vs-intent – Zoe Oct 27 '17 at 10:34

1 Answers1

1

is it possible to open the camera by setting the picture size as 16:9 programatically

No.

There is no requirement for the camera hardware on a device to support 16:9.

Even for those devices that support such a resolution, there is no requirement for a camera app to support 16:9.

Even for those camera apps that support such a resolution, there is no standard means to request this via ACTION_IMAGE_CAPTURE.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • is there any option get what aspect ratio that my camera is selected instead of getting supported preview sizes, so that if 4:3 is selected in camera then i will be using the same in my custom camera. – Aravindh Kumar Nov 03 '17 at 10:55
  • @Aravindh: There are ~2 billion Android devices, spread across ~10,000 device models, with hundreds of different pre-installed camera apps (plus hundreds more camera apps available from the Play Store and elsewhere). None have to support the selection of an aspect ratio or resolution. None have to expose such a selection to third-party apps such as yours. – CommonsWare Nov 03 '17 at 11:12
  • thanks, i am looking for a solution to invoke fullscreen camera in my app via intent, since it looks bad in my ui. – Aravindh Kumar Nov 03 '17 at 11:19
  • @Aravindh: It is up to the camera app, and perhaps the user, how the camera app's UI looks. You do not get a vote. – CommonsWare Nov 03 '17 at 11:27