public class JPEGImageObserver extends java.lang.Object implements CapturedImageObserver
If the filename already exists, it will automatically overwrite the existing image. If the filename contains non-existent intermediate directories, these will be automatically created.
Modified by: Joseph A.Huwaldt
Constructor and Description |
---|
JPEGImageObserver()
Construct a default observer with no filename set and it has not yet captured an
image.
|
Modifier and Type | Method and Description |
---|---|
void |
canvasImageCaptured(java.awt.image.BufferedImage img)
Notification that an image has been captured from the canvas and is ready for
processing.
|
boolean |
captureNextFrame()
Returns a flag indicating if the next frame should be captured or not.
|
void |
setCaptureNextFrame()
Tell the observer to capture the next frame it is told about.
|
void |
setFilename(java.lang.String name)
Set the filename that this will write to.
|
public JPEGImageObserver()
public void setCaptureNextFrame()
public boolean captureNextFrame()
captureNextFrame
in interface CapturedImageObserver
true
if the observer should be passed an image for the next
frame and false
if it should not.public void setFilename(java.lang.String name) throws java.lang.IllegalStateException
name
- The name of the file to write to.java.lang.IllegalStateException
public void canvasImageCaptured(java.awt.image.BufferedImage img)
canvasImageCaptured
in interface CapturedImageObserver
img
- The image that was capturedjava.lang.IllegalStateException
- The filename has not been set