Skip to content
Chris Hafey edited this page May 6, 2014 · 3 revisions

The loadImage api call is used to initiate a load of an image given an imageId. Cornerstone first checks the cache to see if this imageId was previously loaded. If the imageId is not in the cache, Cornerstone attempts to locate a suitable ImageLoader for the imageId and requests the image to be loaded. Since image loading is an asynchronous operation, this function returns a promise which will resolve to an image object on success. Typical workflow is to call displayImage() after a successful load. Note that this function will attempt to locate the imageId in the cache but it will not add loaded images to the cache. Use loadAndCacheImage() if you would like to cache the loaded images.

function loadImage(imageId);

Parameters:

  • imageId - the imageId to load

Returns: A promise which resolves to an Image object once loaded