Package snap.gfx

Class ImageRef

java.lang.Object
snap.gfx.ImageRef

public class ImageRef extends Object
A class provides a unique reference to an image for a given source (URL, bytes).
  • Method Details

    • getName

      public String getName()
      Returns the image name.
    • getSource

      public Object getSource()
      Returns the original source for the image (byte[], File, InputStream or whatever).
    • setSource

      protected void setSource(Object aSource)
      Sets the source (either a WebURL or bytes).
    • getSourceURL

      public WebURL getSourceURL()
      Returns the source URL, if loaded from URL.
    • getImage

      public Image 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

      public static ImageRef getImageRef(Object aSource)
      Returns a unique ImageRef for aSource.