java.lang.Object
com.inductiveautomation.ignition.client.images.ImageLoader

public class ImageLoader extends Object
The ImageLoader is the main interface for the images stored in the Gateway. While they're accessible via a URL, this class will maintain a cache system (both in-memory using soft references and a disk-backed cach) of images and resized versions of them.
  • Method Details

    • getInstance

      public static ImageLoader getInstance()
      Get the shared instance of the ImageLoader
    • setCacheDir

      public static void setCacheDir(File cacheDir)
      Set the directory used to cache images and their resized versions
    • loadImage

      @Deprecated public Image loadImage(String name, int width, int height)
      Deprecated.
    • loadImage

      public Image loadImage(String name)
      Loads the named image. If possible, the image is retrieved from an in-memory image cache.
    • loadImage

      public Image loadImage(String name, Dimension size)
      Loads the named image and resizes it to the given size.
      Parameters:
      name - The path to the image. May be a path to a gateway image or a URL
      size - The size to resize the image to. May be null, which means to use the natural size.
    • loadImageNoCache

      public Image loadImageNoCache(String name, Dimension size)
      Loads the named image at the given size, but skips any caching mechanism. This will download the image and resize it fresh, each time it is called.
      Parameters:
      name - The path to the image or the URL to an image.
      size - The size to resize the image to, or null meaning return the image at its natural size.
    • loadBytes

      public byte[] loadBytes(String name)
      Loads the named image, and returns its raw bytes.
    • clearCache

      public void clearCache()
      Clears the in-memory image cache