Я использую Camera2
API Android. Я могу захватить изображение и сохранить его. Я использую режим autofocus
для фокусировки и захвата изображений.
captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
где есть CaptureBuilder
private CaptureRequest.Builder captureBuilder;
Я хочу показать прямоугольник или круг в области автофокуса в предварительном просмотре камеры, как это происходит в приложении камеры по умолчанию. Например, прямоугольник в середине предварительного просмотра здесь.
Я видел это, но я не хочу ничего трогать где-либо в предварительный просмотр.
Я просмотрел множество примеров, но большинство из них иллюстрируют использование устаревшего класса Camera
, ничего полезного в Camera2
API. Как этот прямоугольник фокусировки может быть достигнут с помощью нового API камеры?