public abstract class ImageFactory
extends java.lang.Object
ImageFactory
contains image creation mechanism on top of different platforms like PC and
Android. System will choose appropriate Factory based on the supported image type.Constructor and Description |
---|
ImageFactory() |
Modifier and Type | Method and Description |
---|---|
abstract Image |
fromFile(java.nio.file.Path path)
Gets
Image from file. |
abstract Image |
fromImage(java.lang.Object image)
Gets
Image from varies Java image types. |
abstract Image |
fromInputStream(java.io.InputStream is)
Gets
Image from InputStream . |
Image |
fromUrl(java.lang.String url)
Gets
Image from URL. |
abstract Image |
fromUrl(java.net.URL url)
Gets
Image from URL. |
static ImageFactory |
getInstance()
Gets new instance of Image factory from the provided factory implementation.
|
public static ImageFactory getInstance()
ImageFactory
public abstract Image fromFile(java.nio.file.Path path) throws java.io.IOException
Image
from file.path
- the path to the imageImage
java.io.IOException
- Image not found or not readablepublic abstract Image fromUrl(java.net.URL url) throws java.io.IOException
Image
from URL.url
- the URL to load fromImage
java.io.IOException
- URL is not valid.public Image fromUrl(java.lang.String url) throws java.io.IOException
Image
from URL.url
- the String represent URL to load fromImage
java.io.IOException
- URL is not valid.public abstract Image fromInputStream(java.io.InputStream is) throws java.io.IOException
Image
from InputStream
.is
- InputStream
Image
java.io.IOException
- image cannot be read from input stream.