Open linnabrown opened 4 years ago
const image = new Image();
image.src = snap. toDataURL();
const a = document.createElement('a');
image.width = width;
image.height = width;
image.onload = () => {
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext('2d').drawImage(image, 0, 0);
a.href = canvas.toDataURL('image/png');
a.download = 'image.png';
a.click();
};
rt