getImageBlobURL
Introduction
getImageBlobURL Export the image content from the canvas, extract the canvas content into the memory Blob, and generate the image's blobURL
Arguments
{object}optionsConfiguration options for exporting images{number}options.devicePixelRatioDevice pixel ratio, default is1
Returns
{Promise<object>}Returns the complete canvas image data{string}blobURLABlobURLto a canvas image in memory{number}widthThe width of the exported image in logical pixels{number}heightThe height of the exported image in logical pixels{number}devicePixelRatioDevice pixel ratio for exported images
Usage
js
import { iDraw } from 'idraw';
const app = document.querySelector('#app');
const options = {
width: 600,
height: 400,
devicePixelRatio: 2
};
const idraw = new iDraw(app, options);
const { blobURL } = await idraw.getImageBlobURL({ devicePixelRatio: 1 });