setZoom method

  1. @override
Future<void> setZoom(
  1. double value
)
override

Set a zoom value for a device.

This must be >= minZoom and <= maxZoom.

This value is a multiplier. For example, a value of 2.0 doubles the size of an image’s subject (and halves the field of view). Allowed values typically range from 1.0 (full field of view) to the value of maxZoom. Setting the value of this property jumps immediately to the new zoom factor. For a smooth transition, use the smoothZoomTo.

zoomSupported should be called before this.

Implementation

@override
Future<void> setZoom(double value) {
  verifyInitialized();
  verifyNotDisposed();
  device.device.lockForConfiguration();
  device.device.setVideoZoomFactor(value);
  return device.device.unlockForConfiguration();
}