Class BufferedImageFactory


  • public class BufferedImageFactory
    extends ImageFactory
    BufferedImageFactory is the default implementation of ImageFactory.
    • Constructor Detail

      • BufferedImageFactory

        public BufferedImageFactory()
    • Method Detail

      • fromFile

        public Image fromFile​(java.nio.file.Path path)
                       throws java.io.IOException
        Gets Image from file.
        Specified by:
        fromFile in class ImageFactory
        Parameters:
        path - the path to the image
        Returns:
        Image
        Throws:
        java.io.IOException - Image not found or not readable
      • fromInputStream

        public Image fromInputStream​(java.io.InputStream is)
                              throws java.io.IOException
        Gets Image from InputStream.
        Specified by:
        fromInputStream in class ImageFactory
        Parameters:
        is - InputStream
        Returns:
        Image
        Throws:
        java.io.IOException - image cannot be read from input stream.
      • fromImage

        public Image fromImage​(java.lang.Object image)
        Gets Image from varies Java image types.

        Image can be BufferedImage or BitMap depends on platform

        Specified by:
        fromImage in class ImageFactory
        Parameters:
        image - the image object.
        Returns:
        Image
      • save

        protected void save​(java.awt.image.BufferedImage image,
                            java.io.OutputStream os,
                            java.lang.String type)
                     throws java.io.IOException
        Throws:
        java.io.IOException