public class CameraHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
javax.microedition.media.control.VideoControl |
camera_controller |
static CameraHandler |
instance
Our instance
|
javax.microedition.media.Player |
video_player |
Constructor and Description |
---|
CameraHandler() |
Modifier and Type | Method and Description |
---|---|
void |
createCamera()
Create the camera object
|
void |
createCamera(int x,
int y,
int width,
int height)
Create the camera object, positioning the preview on to the canvas, not available on all platforms
|
javax.microedition.lcdui.Image |
getCameraSnapshot(java.lang.String imageType)
Captures an image from the camera and returns it
|
javax.microedition.lcdui.Image |
getCameraSnapshot(java.lang.String imageType,
int width,
int height)
Captures an image from the camera and returns it resized to the desired size
|
void |
initCamera(javax.microedition.lcdui.Canvas previewCanvas)
Initialize the camera display
|
void |
stopCamera()
Stop the camera display
|
public static CameraHandler instance
public javax.microedition.media.Player video_player
public javax.microedition.media.control.VideoControl camera_controller
public void createCamera()
public void createCamera(int x, int y, int width, int height)
x
- Position the camera preview to the x co-ordinate requestedy
- Position the camera preview to the y co-ordinate requestedwidth
- Set the camera preview to the width requestedheight
- Set the camera preview to the height requestedpublic void initCamera(javax.microedition.lcdui.Canvas previewCanvas)
previewCanvas
- Canvas to render camera preview on topublic javax.microedition.lcdui.Image getCameraSnapshot(java.lang.String imageType)
imageType
- Set format and resolution for the image, null returns default.public javax.microedition.lcdui.Image getCameraSnapshot(java.lang.String imageType, int width, int height)
imageType
- Set format and resolution for the image, null returns default.width
- Width of the image requestedheight
- Height of the image requestedpublic void stopCamera()