public static WritableImage toFXImage (BufferedImage bimg, WritableImage wimg)

Snapshots the specified BufferedImage and stores a copy of its pixels into a JavaFX Image object, creating a new object if needed. The returned Image will be a static snapshot of the state of the pixels in the BufferedImage at the time the method completes. Further changes to the BufferedImage will not be reflected in the Image.

The optional JavaFX WritableImage parameter may be reused to store the copy of the pixels. A new Image will be created if the supplied object is null, is too small or of a type which the image pixels cannot be easily converted into.

Parameters:
bimg    the BufferedImage object to be converted
wimg    an optional WritableImage object that can be used to store the returned pixel data

Returns:  an Image object representing a snapshot of the current pixels in the BufferedImage.

Since:  JavaFX 2.2