public class CameraPreview
extends java.lang.Object
implements android.view.SurfaceHolder.Callback
| Constructor and Description |
|---|
CameraPreview(android.content.Context context,
java.lang.Boolean withPreview,
android.widget.ImageButton flashButton,
android.widget.ImageButton captureImage,
android.widget.ImageButton flipCamera)
Custom constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
doTouchFocus(android.graphics.Rect focusRect)
Called from PreviewSurfaceView to set touch focus.
|
int |
getCameraID()
Get the camera id in order to prepare additional information concerning
the camera using the CameraInfoHelper class.
|
void |
onOrientationChanged(int orientation)
Change the orientation of the picture that will be shot by the camera
|
void |
releaseCamera()
Release the camera if it not equal to null.
|
void |
surfaceChanged(android.view.SurfaceHolder surfaceHolder,
int i,
int i1,
int i2)
Start preview with new settings.
|
void |
surfaceCreated(android.view.SurfaceHolder surfaceHolder)
Try to open the camera when the surface is created.
|
void |
surfaceDestroyed(android.view.SurfaceHolder surfaceHolder)
Try to release the camera when the surface is destroyed.
|
public CameraPreview(android.content.Context context,
java.lang.Boolean withPreview,
android.widget.ImageButton flashButton,
android.widget.ImageButton captureImage,
android.widget.ImageButton flipCamera)
context - flashButton - captureImage - flipCamera - public int getCameraID()
public void surfaceCreated(android.view.SurfaceHolder surfaceHolder)
surfaceCreated in interface android.view.SurfaceHolder.CallbacksurfaceHolder - - the assigned surface holder.public void surfaceChanged(android.view.SurfaceHolder surfaceHolder,
int i,
int i1,
int i2)
surfaceChanged in interface android.view.SurfaceHolder.CallbacksurfaceHolder - i - i1 - i2 - public void surfaceDestroyed(android.view.SurfaceHolder surfaceHolder)
surfaceDestroyed in interface android.view.SurfaceHolder.CallbacksurfaceHolder - - the assigned surfaceholderpublic void doTouchFocus(android.graphics.Rect focusRect)
focusRect - - new area for auto focuspublic void releaseCamera()
public void onOrientationChanged(int orientation)
orientation - - the current orientation