Class FileEncodedImage
- All Implemented Interfaces:
ActionSource
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileEncodedImageCreates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed.static FileEncodedImageCreates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed.static FileEncodedImagecreate(String fileName, InputStream i, int width, int height) Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed.byte[]Returns the byte array data backing the image allowing the image to be stored and discarded completely from RAM.Methods inherited from class EncodedImage
asyncLock, create, create, create, create, create, createFromImage, createFromRGB, createMulti, drawImage, drawImage, getGraphics, getHeight, getImage, getInternal, getWidth, isAnimation, isLocked, isOpaque, lock, modifyAlpha, modifyAlpha, resetCache, rotate, scale, scaled, scaledEncoded, scaledHeight, scaledSmallerRatio, scaledWidth, subImage, toRGB, unlockMethods inherited from class Image
addActionListener, animate, applyMask, applyMask, applyMaskAutoScale, createImage, createImage, createImage, createImage, createImage, createImage, createImage, createIndexed, createMask, createSVG, dispose, exifRotation, exifRotation, exifRotation, fill, fireChangedEvent, flipHorizontally, flipVertically, getExifOrientationTag, getExifOrientationTag, getImageName, getRGB, getRGB, getRGBCached, getSVGDocument, isAlphaMutableImageSupported, isJPEG, isPNG, isSVG, isSVGSupported, mirror, modifyAlphaWithTranslucency, removeActionListener, requiresDrawImage, rotate180Degrees, rotate270Degrees, rotate90Degrees, scaledLargerRatio, setImageName
-
Method Details
-
create
Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed. This only works reasonably well for very small files.
Parameters
-
fileName: the name of the file -
width: the width of the file or -1 if unknown (notice that this will improve performance) -
height: the height of the file or -1 if unknown (notice that this will improve performance)
Returns
image that will load the file seamlessly
-
-
create
public static FileEncodedImage create(String fileName, InputStream i, int width, int height) throws IOException Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed. This only works reasonably well for very small files. This version of the method creates the file from an input stream
Parameters
-
fileName: the name of the file -
i: input stream from which to create the file -
width: the width of the file or -1 if unknown (notice that this will improve performance) -
height: the height of the file or -1 if unknown (notice that this will improve performance)
Returns
image that will load the file seamlessly
- Throws:
IOException
-
-
create
Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed. This only works reasonably well for very small files.
Parameters
-
fileName: the name of the file -
width: the width of the file or -1 if unknown (notice that this will improve performance) -
height: the height of the file or -1 if unknown (notice that this will improve performance) -
keep: if set to true keeps the file in RAM once loaded
Returns
image that will load the file seamlessly
-
-
getImageData
public byte[] getImageData()Returns the byte array data backing the image allowing the image to be stored and discarded completely from RAM.
Returns
byte array used to create the image, e.g. encoded PNG, JPEG etc.
- Overrides:
getImageDatain classEncodedImage
-