Skip to main content

@microsoft/fast-colors > loadImageData

loadImageData() function

Creates an HTMLImageElement and loads the source argument as its src. Then an HTMLCanvasElement is created and the image is copied into the canvas. The pixel data is then returned from the CanvasRenderingContext2D for that canvas.

Signature:
export declare function loadImageData(source: string): Promise<ImageData>;

Parameters

ParameterTypeDescription
sourcestring
Returns:

Promise<ImageData>