What codes to use to zoom in on the camera?

3

My group is doing a camera app. We just do not know what code to use to zoom in on the camera. Does anyone know how to do it?

    
asked by anonymous 04.08.2015 / 17:58

1 answer

1

This below will work if the user's Android is:

  • API 8 +
   Camera.Parameters parameters = camera.getParameters();
   int maxZoom = parameters.getMaxZoom(); 
      if (parameters.isZoomSupported()) {
        if (zoom >=0 && zoom < maxZoom) {
         parameters.setZoom(zoom);
      } else {
        // zoom parameter incorreto
      }
     }
    
13.08.2015 / 02:38