13 lines
388 B
TypeScript
13 lines
388 B
TypeScript
export default function(dataObject: any) {
|
|
// Create a blob from the UInt8Array data
|
|
const blob = new Blob([dataObject.data], { type: dataObject.format });
|
|
|
|
// Create a URL for the blob
|
|
const imageUrl = URL.createObjectURL(blob);
|
|
|
|
// Create an Image object
|
|
const image = new Image();
|
|
image.src = imageUrl;
|
|
|
|
return imageUrl; // return the URL of the image
|
|
} |