To take pictures with this class, use the following steps:
1. Obtain an instance of Camera from open(int).
2. Get existing (default) settings with getParameters().
3. If necessary, modify the returned Camera.Parameters object and call setParameters(Camera.Parameters).
4. If desired, call setDisplayOrientation(int).
5. Important: Pass a fully initialized SurfaceHolder to setPreviewDisplay(SurfaceHolder). Without a surface, the camera will be unable to start the preview.
6. Important: Call startPreview() to start updating the preview surface. Preview must be started before you can take a picture.
7. When you want, call takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback, Camera.PictureCallback) to capture a photo. Wait for the callbacks to provide the actual image data.
8. After taking a picture, preview display will have stopped. To take more photos, call startPreview() again first.
9. Call stopPreview() to stop updating the preview surface.
10. Important: Call release() to release the camera for use by other applications. Applications should release the camera immediately in onPause() (and re-open() it in onResume()).
Partager