public final class ImageExtensions extends Object
Contains extension methods for conversions based on System.Drawing.Image
and Image
.
Modifier and Type | Method and Description |
---|---|
static RasterImage |
fromJava(BufferedImage image)
Converts the
BufferedImage to the PngImage . |
static RasterImage |
fromJava(BufferedImage image,
Rectangle rect)
Converts the
BufferedImage to the PngImage . |
static BufferedImage |
toJava(Image image)
Converts the
Image to the BufferedImage . |
static BufferedImage |
toJava(Image image,
Rectangle subImageRect)
Takes the subimage from
Image and converts to the BufferedImage . |
public static RasterImage fromJava(BufferedImage image, Rectangle rect)
Converts the BufferedImage
to the PngImage
.
image
has. To get all parts of the image use more safe extension method ToGdiImageFull.image
- The BufferedImage
to convert.rect
- The required rectangle.PngImage
.public static RasterImage fromJava(BufferedImage image)
Converts the BufferedImage
to the PngImage
.
image
- The BufferedImage
to convert.PngImage
.public static BufferedImage toJava(Image image)
Converts the Image
to the BufferedImage
.
image
- The Image
to convert.BufferedImage
.public static BufferedImage toJava(Image image, Rectangle subImageRect)
Takes the subimage from Image
and converts to the BufferedImage
.
image
- The Image
to convert.subImageRect
- The rectangle of subimage to convert.BufferedImage
contains subimage taken from Image
.