Class ImageLoader
java.lang.Object
com.inductiveautomation.ignition.client.images.ImageLoader
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 Summary
Modifier and TypeMethodDescriptionvoid
Clears the in-memory image cachestatic ImageLoader
Get the shared instance of the ImageLoaderbyte[]
Loads the named image, and returns its raw bytes.Loads the named image.Deprecated.Loads the named image and resizes it to the given size.loadImageNoCache
(String name, Dimension size) Loads the named image at the given size, but skips any caching mechanism.static void
setCacheDir
(File cacheDir) Set the directory used to cache images and their resized versions
-
Method Details
-
getInstance
Get the shared instance of the ImageLoader -
setCacheDir
Set the directory used to cache images and their resized versions -
loadImage
Deprecated.useloadImage(String, Dimension)
instead. -
loadImage
Loads the named image. If possible, the image is retrieved from an in-memory image cache. -
loadImage
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 URLsize
- The size to resize the image to. May be null, which means to use the natural size.
-
loadImageNoCache
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
Loads the named image, and returns its raw bytes. -
clearCache
public void clearCache()Clears the in-memory image cache
-
loadImage(String, Dimension)
instead.