JavaFX 2.2 has a "snapshot" feature that enables you to take a picture of any node or scene.
Take a look at the API Documentation and you will find new
snapshot methods in the
The most basic version has the following signature:
public WritableImage snapshot(WritableImage image)
WritableImage class (also introduced in JavaFX 2.2) lives in the
javafx.scene.image package, and
represents a custom graphical image that is constructed from pixels supplied by the application.
In fact, there are 5 new classes in
PixelFormat: Defines the layout of data for a pixel of a given format.
WritablePixelFormat: Represents a pixel format that can store
PixelReader: Defines methods for retrieving the pixel data from an
Imageor other surface containing pixels.
PixelWriter: Defines methods for writing the pixel data of a
WritableImageor other surface containing writable pixels.
WritableImage: Represents a custom graphical image that is constructed from pixels supplied by
The API documentation contains lots of information, so go investigate and have fun with these useful new classes!