cubesoft
cubesoft

Reputation: 3550

Android CameraX - CameraView and ImageCapture in one activity

I am trying to use CameraView image capture. Unfortunatelly the takePicture method does not allow any configuration. I want to capture photos at specific resolution. When I use ImageCapture, I need to setup CameraX objects manually. How to deal with it?

Upvotes: 1

Views: 645

Answers (1)

Husayn Hakeem
Husayn Hakeem

Reputation: 4570

CameraView is a high level CameraX component that allows to easily use the Preview, ImageCapture and VideoCapture use cases, and attach the opening/closing of a camera to a lifecycle, the convenience it provides comes at the expense of flexibility/configurability. If you just need something to easily display a preview and take pictures/videos, you should use CameraView, but if you need more control over things like the resolution of image capture, you'll need to configure and build the use cases, and set up the camera yourself.

Note that CameraView also provides some additional nice features, like tap-to-focus and pinch-to-zoom, which you'd have to implement on your own if you manually set up the Preview and ImageCapture use cases.

Upvotes: 2

Related Questions