public class Capture extends Object
Constructor and Description |
---|
Capture() |
Modifier and Type | Method and Description |
---|---|
static String |
captureAudio()
Same as captureAudio only a blocking version that holds the EDT
|
static void |
captureAudio(ActionListener response)
This method tries to invoke the device native hardware to capture audio.
|
static String |
capturePhoto()
Invokes the camera and takes a photo synchronously while blocking the EDT
|
static void |
capturePhoto(ActionListener response)
This method tries to invoke the device native camera to capture images.
|
static String |
capturePhoto(int width,
int height)
Invokes the camera and takes a photo synchronously while blocking the EDT
|
static String |
captureVideo()
Same as captureVideo only a blocking version that holds the EDT
|
static void |
captureVideo(ActionListener response)
This method tries to invoke the device native camera to capture video.
|
static boolean |
hasCamera()
Returns true if the device has camera false otherwise.
|
public static boolean hasCamera()
public static void capturePhoto(ActionListener response)
response
- a callback Object to retrieve the file pathRuntimeException
- if this feature failed or unsupported on the platformpublic static String capturePhoto()
public static String captureAudio()
public static String captureVideo()
public static String capturePhoto(int width, int height)
width
- the target width for the image if possible, some platforms don't support scaling. To maintain aspect ratio set to -1height
- the target height for the image if possible, some platforms don't support scaling. To maintain aspect ratio set to -1public static void captureAudio(ActionListener response)
response
- a callback Object to retrieve the file pathRuntimeException
- if this feature failed or unsupported on the platformpublic static void captureVideo(ActionListener response)
response
- a callback Object to retrieve the file pathRuntimeException
- if this feature failed or unsupported on the platform