org.eclipse.graphiti.export.batik
Class ImageConverter
java.lang.Object
org.eclipse.graphiti.export.batik.ImageConverter
public class ImageConverter
- extends Object
This is a helper class used to convert an SWT Image into an AWT
BufferedImage.
This class is originally from GMF and was adapted for Graphiti needs.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PALETTE_DATA
private static final PaletteData PALETTE_DATA
ImageConverter
public ImageConverter()
convert
public static Image convert(BufferedImage srcImage)
- Converts an AWT based buffered image into an SWT
Image. This
will always return an Image that has 24 bit depth regardless
of the type of AWT buffered image that is passed into the method.
- Parameters:
srcImage - the BufferedImage to be converted to an
Image
- Returns:
- an
Image that represents the same image data as the
AWT BufferedImage type.
convertToImageData
public static ImageData convertToImageData(BufferedImage srcImage)
- Converts an AWT based buffered image into an SWT
ImageData.
This will always return an ImageData that has 24 bit depth
regardless of the type of AWT buffered image that is passed into the
method.
- Parameters:
srcImage - the BufferedImage to be converted to an
Image
- Returns:
- an
Image that represents the same image data as the
AWT BufferedImage type. - Since:
- 1.3.1
convertFromImageData
public static BufferedImage convertFromImageData(ImageData imageData)
- Converts an swt based image data into an AWT
BufferedImage.
This will always return a BufferedImage that is of type
BufferedImage.TYPE_INT_ARGB regardless of the type of swt
image that is passed into the method.
- Parameters:
imageData - the org.eclipse.swt.graphics.Image to be converted to
a BufferedImage
- Returns:
- a
BufferedImage that represents the same image data
as the swt Image - Since:
- 1.3.1
Copyright (c) SAP AG 2005, 2012.