Hello,
You need to get CameraControl
, then you can set the SetLinearZoom
.
Firstly, you need to find the cameraProvider.BindToLifecycle
, then get the CameraControl
like following code.
// Bind use cases to camera
CameraControl = cameraProvider.BindToLifecycle(this, cameraSelector, preview, imageCapture, imageAnalyzer).CameraControl;
In the end, you can setLinearZoom, for testing, I change the linearzoom in the button click event like following code.
AndroidX.Camera.Core.ICameraControl CameraControl;
float zoomrate = 0.1f;
private void Camera_Move_button_Click(object sender, System.EventArgs e)
{
zoomrate += 0.1f;
CameraControl.SetLinearZoom(zoomrate);
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.