Class ImageConverter
java.lang.Object
org.eclipse.graphiti.export.batik.ImageConverter
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.swt.graphics.Imageconvert(BufferedImage srcImage) Converts an AWT based buffered image into an SWTImage.static BufferedImageconvert(org.eclipse.swt.graphics.Image srcImage) Converts an swt based image into an AWTBufferedImage.static BufferedImageconvertFromImageData(org.eclipse.swt.graphics.ImageData imageData) Converts an swt based image data into an AWTBufferedImage.static org.eclipse.swt.graphics.ImageDataconvertToImageData(BufferedImage srcImage) Converts an AWT based buffered image into an SWTImageData.
-
Constructor Details
-
ImageConverter
public ImageConverter()
-
-
Method Details
-
convert
Converts an AWT based buffered image into an SWTImage. This will always return anImagethat has 24 bit depth regardless of the type of AWT buffered image that is passed into the method.- Parameters:
srcImage- theBufferedImageto be converted to anImage- Returns:
- an
Imagethat represents the same image data as the AWTBufferedImagetype.
-
convertToImageData
Converts an AWT based buffered image into an SWTImageData. This will always return anImageDatathat has 24 bit depth regardless of the type of AWT buffered image that is passed into the method.- Parameters:
srcImage- theBufferedImageto be converted to anImage- Returns:
- an
Imagethat represents the same image data as the AWTBufferedImagetype. - Since:
- 1.3.1
-
convert
Converts an swt based image into an AWTBufferedImage. This will always return aBufferedImagethat is of typeBufferedImage.TYPE_INT_ARGBregardless of the type of swt image that is passed into the method.- Parameters:
srcImage- theImageto be converted to aBufferedImage- Returns:
- a
BufferedImagethat represents the same image data as the swtImage
-
convertFromImageData
Converts an swt based image data into an AWTBufferedImage. This will always return aBufferedImagethat is of typeBufferedImage.TYPE_INT_ARGBregardless of the type of swt image that is passed into the method.- Parameters:
imageData- theImageto be converted to aBufferedImage- Returns:
- a
BufferedImagethat represents the same image data as the swtImage - Since:
- 1.3.1
-