public final class ReplaceableImage
- Object
- Image
- EncodedImage
- ReplaceableImage
ImplementsActionSource
Methods
public static ReplaceableImage create(EncodedImage placeholder) | Creates an encoded image that can later be replaced with a different image |
public byte[] getImageData() | Returns the byte array data backing the image allowing the image to be stored and discarded completely from RAM. |
public void replace(EncodedImage newImage) | Replaces the current image with the new image which must match the dimensions etc. of the previous image. |
public boolean animate() | Advances this image’s animation state, if it is animated. |
public boolean isAnimation() | Returns true if this is an animated image |
public boolean isOpaque() | Indicates whether this image is opaque or not |
Inherited methods
From EncodedImage
createMulti, createFromImage, createFromRGB, create, create, create, create, create, resetCache, dispose, isDisposed, getImage, getInternal, isLocked, asyncLock, lock, unlock, subImage, rotate, modifyAlpha, modifyAlpha, getGraphics, getWidth, getHeight, drawImage, drawImage, toRGB, scaledWidth, scaledHeight, scaledSmallerRatio, scaledEncoded, scaled, scale
From Image
isSimdOptimizationsEnabled, setSimdOptimizationsEnabled, resetSimdOptimizationsEnabled, isSVGSupported, createSVG, createIndexed, createImage, createImage, createImage, createImage, createImage, isAlphaMutableImageSupported, createImage, createImage, exifRotation, exifRotation, exifRotation, getExifOrientationTag, getExifOrientationTag, isJPEG, isPNG, getSVGDocument, isSVG, createMask, applyMask, applyMask, applyMaskAutoScale, mirror, modifyAlphaWithTranslucency, getRGB, getRGB, getRGBCached, scaledLargerRatio, fill, getImageName, setImageName, rotate90Degrees, rotate180Degrees, rotate270Degrees, flipHorizontally, flipVertically, requiresDrawImage, addActionListener, removeActionListener, fireChangedEvent
Method details
create
public static ReplaceableImage create(EncodedImage placeholder)Parameters
placeholderEncodedImage- a temporary image
Returns
getImageData
public byte[] getImageData()Returns
replace
public void replace(EncodedImage newImage)Parameters
newImageEncodedImage- the image to apply
animate
public boolean animate()Returns
true if the animation state changed.isAnimation
public boolean isAnimation()Returns
isOpaque
public boolean isOpaque()