imageElementFromUrl Function

Create an html Image element from a URL.

imageElementFromUrl(url: string, skipCrossOriginCheck: booleanfalse): Promise<HTMLImageElement>

@returns A Promise resolving to an HTMLImageElement when the image data has been loaded from the URL.

@see tryImageElementFromUrl

Parameter Type Description
url string The URL pointing to the image data.
skipCrossOriginCheck boolean Set this to true to allow an image from a different origin than the web app to load. Default is false.

Returns - Promise<HTMLImageElement>

A Promise resolving to an HTMLImageElement when the image data has been loaded from the URL.

Defined in

Last Updated: 17 December, 2024