Is it possible to show a rectangle in the camera that captures the image only the rectangular part of the camera and skips all other parts?
I don't want to use any third-party library. I want to use simple CameraX.
Is it possible to show a rectangle in the camera that captures the image only the rectangular part of the camera and skips all other parts?
I don't want to use any third-party library. I want to use simple CameraX.
Copyright © 2021 Jogjafile Inc.

You can take a picture of the whole FOV then crop it.
The challenge is that the Preview and ImageCapture usually have different resolution, rotation and mirroring. To do that, you will need to transform your Preview crop rect into ImageCapture coordinate system.
You can take a look at the CoordinateTransform API provided by CameraX.