how to zoom in/out using android phone camera
i am using the camera.setSmoothZoom(i) function of the Camera class but its not helping me out. i have tried out camera.getPa开发者_高级运维rameters().setZoom(i) function but still i am not getting any success. Does anyone know how to zoom in/zoom out on android phone camera.. thanks in advance..
The setZoom() function wasn't added until API Level 8 (aka Froyo, Android 2.2). Right now, you probably don't have access to a device running Froyo.
You'll need to manually set the camera parameters. See the zxing Barcode Scanner app for an example of how to do this:
http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java
(Search that file for setZoom
.)
Also, keep in mind that not all cameras support zoom. You'll need to check, either by calling isZoomSupported (API Level 8) or checking the parameters string for zoom-supported
.
精彩评论