Packages

 

com.aspose.imaging.extensions

Class ImageExtensions



  • public class ImageExtensions
    extends Object

    Contains extension methods for conversions based on System.Drawing.Image and Image.

    • Method Detail

      • fromJava

        public static RasterImage fromJava(BufferedImage image,
                                           Rectangle rect)

        Converts the BufferedImage to the PngImage.

        Warning, the GDI image may get lower bounds than image has. To get all parts of the image use more safe extension method ToGdiImageFull.
        Parameters:
        image - The BufferedImage to convert.
        rect - The required rectangle.
        Returns:
        The converted PngImage.
      • fromJava

        public static RasterImage fromJava(BufferedImage image)

        Converts the BufferedImage to the PngImage.

        Parameters:
        image - The BufferedImage to convert.
        Returns:
        The converted PngImage.
      • toJava

        public static BufferedImage toJava(Image image)

        Converts the Image to the BufferedImage.

        Parameters:
        image - The Image to convert.
        Returns:
        The converted BufferedImage.
      • toJava

        public static BufferedImage toJava(Image image,
                                           Rectangle subImageRect)

        Takes the subimage from Image and converts to the BufferedImage.

        Parameters:
        image - The Image to convert.
        subImageRect - The rectangle of subimage to convert.
        Returns:
        The converted BufferedImage contains subimage taken from Image.