Skip to main content

Abstract Class: ImageCache

Defined in: src/sdk/graphics/img/ImageCache.ts:13

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​

ImageCache

Methods​

addToCache()​

static addToCache(key, url): void

Defined in: src/sdk/graphics/img/ImageCache.ts:22

Loads the image from the url and adds it to the cache.

Parameters​

ParameterTypeDescription
keystringThe image key to access it later.
urlstringThe url to load the image from.

Returns​

void

Static​


get()​

static get(key): HTMLImageElement

Defined in: src/sdk/graphics/img/ImageCache.ts:36

Gets a cached image element.

Parameters​

ParameterTypeDescription
keystringThe key of the cached image.

Returns​

HTMLImageElement

The cached image element.

Static​