Class StorageImageAsync
- All Implemented Interfaces:
ActionSource
-
Method Summary
Modifier and TypeMethodDescriptionbooleananimate()static StorageImageAsyncCreates an encoded image that maps to a storage file thus allowing to seamlessly cache images as needed.byte[]Returns the byte array data backing the image allowing the image to be stored and discarded completely from RAM.protected ImageReturns the actual image represented by the encoded image, this image will be cached in a weak/soft reference internally.booleanReturns true if this is an animated imageprotected voidA subclass might choose to load asynchroniously and reset the cache when the image is ready.Methods inherited from class EncodedImage
asyncLock, create, create, create, create, create, createFromImage, createFromRGB, createMulti, drawImage, drawImage, getGraphics, getHeight, getImage, getWidth, isLocked, isOpaque, lock, modifyAlpha, modifyAlpha, rotate, scale, scaled, scaledEncoded, scaledHeight, scaledSmallerRatio, scaledWidth, subImage, toRGB, unlockMethods inherited from class Image
addActionListener, 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 storage file thus allowing to seamlessly cache images as needed. This only works reasonably well for very small files.
Parameters
-
fileName: the name of the storage file -
placeholder: an image that must be of the same size as the EncodedImage
Returns
image that will load the file seamlessly
-
-
resetCache
protected void resetCache()A subclass might choose to load asynchroniously and reset the cache when the image is ready.- Overrides:
resetCachein classEncodedImage
-
getInternal
Returns the actual image represented by the encoded image, this image will be cached in a weak/soft reference internally. This method is useful to detect when the system actually created an image instance. You shouldn't invoke this method manually!
Returns
drawable image instance
- Overrides:
getInternalin classEncodedImage
-
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
-
animate
-
isAnimation
public boolean isAnimation()Returns true if this is an animated image
Returns
true if this image represents an animation
- Overrides:
isAnimationin classEncodedImage
-