Class: ImageCache
A class for caching images. Do your own instrument specific implementation with an init() method that will add images to cache on instrument load to prefill the cache. ImageCache
Constructors
constructor
• new ImageCache(): ImageCache
Returns
Methods
addToCache
▸ addToCache(key
, url
): void
Loads the image from the url and adds it to the cache.
Parameters
Name | Type | Description |
---|---|---|
key | string | The image key to access it later. |
url | string | The url to load the image from. |
Returns
void
Static
Defined in
src/sdk/graphics/img/ImageCache.ts:22
get
▸ get(key
): HTMLImageElement
Gets a cached image element.
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the cached image. |
Returns
HTMLImageElement
The cached image element.
Static
Defined in
src/sdk/graphics/img/ImageCache.ts:36