public abstract class ImageCapture extends CaptureBase
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_IMAGE_SOURCE |
PROPERTY_CAPTURE_AREA, PROPERTY_CAPTURE_TRANSPARENT_WINDOWS, PROPERTY_INCLUDE_CURSOR
Modifier | Constructor and Description |
---|---|
protected |
ImageCapture()
Creates new image capture.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
copyToClipboard()
Copies this capture to the system clipboard as a bitmap.
|
static ImageCapture |
create()
Factory method that creates new instance of image capture instance depending on a current platform.
|
static ImageCapture |
create(ImageSource source)
Factory method that creates new instance of image capture instance depending on a current platform and specified image source.
|
static ImageCapture |
create(com.teamdev.jxdesktop.UIElement element)
Factory method that creates new instance of image capture instance depending on a current platform.
|
abstract java.awt.image.BufferedImage |
getImage()
Returns a Java image of this image capture.
|
ImageSource |
getImageSource()
Returns the specified video source.
|
abstract void |
release()
Releases all resources of this image capture.
|
ImageCapture |
resize(java.awt.Dimension dimensions)
This method resizes this image capture using default interpolation mode
InterpolationMode.Default |
abstract ImageCapture |
resize(java.awt.Dimension dimensions,
InterpolationMode interpolation)
Resizes this image capture to new dimensions using the specified interpolation mode.
|
boolean |
save(java.io.File file,
ImageFormat format)
Saves this image capture to a file with the specified image format using the best compression quality.
|
abstract boolean |
save(java.io.File file,
ImageFormat format,
CompressionQuality quality)
Saves this image capture to a file with the specified image format.
|
void |
setImageSource(ImageSource source)
Specifies video source for recording.
|
abstract ImageCapture |
takeSnapshot()
Takes a snapshot of a specified capture area.
|
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image image)
Converts given image to buffered image.
|
addPropertyChangeListener, addPropertyChangeListener, getCaptureArea, getPropertyChangeSupport, isCaptureTransparentWindows, isIncludeCursor, removePropertyChangeListener, setCaptureArea, setCaptureTransparentWindows, setIncludeCursor
public static final java.lang.String PROPERTY_IMAGE_SOURCE
public static ImageCapture create()
public static ImageCapture create(com.teamdev.jxdesktop.UIElement element)
element
- defines UI element to capturepublic static ImageCapture create(ImageSource source)
source
- image sourcepublic abstract ImageCapture takeSnapshot()
resize(java.awt.Dimension, InterpolationMode)
method,
or saved to the file using the save(java.io.File, com.teamdev.jxcapture.image.ImageFormat, CompressionQuality)
method, or just returned as Java image using
the getImage()
method.public abstract java.awt.image.BufferedImage getImage()
Before calling this method you should invoke the takeSnapshot()
method first.
public abstract ImageCapture resize(java.awt.Dimension dimensions, InterpolationMode interpolation)
Before calling this method you should invoke the takeSnapshot()
method first.
dimensions
- specifies new dimensionsinterpolation
- specifies interpolation modepublic ImageCapture resize(java.awt.Dimension dimensions)
InterpolationMode.Default
Before calling this method you should invoke the takeSnapshot()
method first.
dimensions
- specifies new dimensionspublic abstract boolean save(java.io.File file, ImageFormat format, CompressionQuality quality) throws java.io.IOException
Before calling this method you should invoke the takeSnapshot()
method first.
file
- destination fileformat
- required image formatquality
- required compression quality of resulting imagejava.io.IOException
- if any error occurs during the operationpublic boolean save(java.io.File file, ImageFormat format) throws java.io.IOException
Before calling this method you should invoke the takeSnapshot()
method first.
file
- destination fileformat
- required image formatjava.io.IOException
- if any error occurs during the operationpublic abstract void copyToClipboard()
public abstract void release()
public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
image
- image to convertpublic ImageSource getImageSource()
public void setImageSource(ImageSource source)
source
- new video source