Skip to main content

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

ImageCache

Methods

addToCache

addToCache(key, url): void

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

Parameters

NameTypeDescription
keystringThe image key to access it later.
urlstringThe 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

NameTypeDescription
keystringThe key of the cached image.

Returns

HTMLImageElement

The cached image element.

Static

Defined in

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