public class SWTFXUtils extends Object
|Modifier and Type||Method and Description|
Snapshots the specified JavaFX
Snapshots the specified
public static WritableImage toFXImage(org.eclipse.swt.graphics.ImageData imageData, WritableImage image)
ImageDataand stores a copy of its pixels into a JavaFX
Imageobject, creating a new object if needed. The returned
Imagewill be a static snapshot of the state of the pixels in the
ImageDataat the time the method completes. Further changes to the
ImageDatawill not be reflected in the
The optional JavaFX
WritableImage parameter may be reused
to store the copy of the pixels.
Image will be created if the supplied object is null,
is too small or of a type which the image pixels cannot be easily
ImageDataobject to be converted
image- an optional
WritableImageobject that can be used to store the returned pixel data
Imageobject representing a snapshot of the current pixels in the
ImageData, or null if the
Imageis not readable.
public static org.eclipse.swt.graphics.ImageData fromFXImage(Image image, org.eclipse.swt.graphics.ImageData imageData)
Imageobject and stores a copy of its pixels into a new
ImageDataobject. The method will only convert a JavaFX
Imagethat is readable as per the conditions on the
Image.getPixelReader()method. If the
Imageis not readable, as determined by its
getPixelReader()method, then this method will return null. If the
Imageis a writable, or other dynamic image, then the
ImageDatawill only be set to the current state of the pixels in the image as determined by its
PixelReader. Further changes to the pixels of the
Imagewill not be reflected in the returned
ImageData parameter may be reused to store
the copy of the pixels.
ImageData 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.
image- the JavaFX
Imageto be converted
imageData- an optional
ImageDataobject that may be used to store the returned pixel data
ImageDatacontaining a snapshot of the JavaFX
Image, or null if the
Imageis not readable.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.