Package snap.gfx
Class ImageRef
java.lang.Object
snap.gfx.ImageRef
A class provides a unique reference to an image for a given source (URL, bytes).
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
Returns the original bytes for the image (loaded from the source).getImage()
Returns the image.static ImageRef
getImageRef
(Object aSource) Returns a unique ImageRef for aSource.getName()
Returns the image name.Returns the original source for the image (byte[], File, InputStream or whatever).Returns the source URL, if loaded from URL.protected void
refresh()
Refreshes data from source.protected void
Sets the source (either a WebURL or bytes).
-
Method Details
-
getName
Returns the image name. -
getSource
Returns the original source for the image (byte[], File, InputStream or whatever). -
setSource
Sets the source (either a WebURL or bytes). -
getSourceURL
Returns the source URL, if loaded from URL. -
getImage
Returns the image. -
getBytes
public byte[] getBytes()Returns the original bytes for the image (loaded from the source). -
refresh
protected void refresh()Refreshes data from source. -
getImageRef
Returns a unique ImageRef for aSource.
-