Display a rectangular bounding box (overlay) on custom Camera2 API so only the image inside the box is captured
问题 I'm using the following code to capture an image using the custom Camera2 API. I am a beginner and I have no idea how to display a rectangular overlay on the camera preview. I did try the solutions available here, but I can't figure out how to fit it in my code. I need to achieve something like this to capture A4 sheets. Only the part of the image which is in the box must be captured and displayed in the next activity. MainActivity package com.example.customcamera; import android.Manifest;