Skip to content

Commit 777ad8b

Browse files
authored
Update SaveInterface.js calling block artwork png
1 parent d437bba commit 777ad8b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

js/SaveInterface.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,21 @@ class SaveInterface {
311311
const svg = "data:image/svg+xml;utf8," + activity.printBlockSVG();
312312
activity.save.download("svg", svg, null);
313313
}
314+
315+
/**
316+
* This method is to save BlockArtwork and download the PNG representation of block artwork from the provided activity.
317+
*
318+
* @param {SaveInterface} activity - The activity object containing block artwork to save.
319+
* @returns {void}
320+
* @method
321+
* @instance
322+
*/
323+
saveBlockArtworkPNG(activity) {
324+
activity.printBlockPNG().then((pngDataUrl) => {
325+
activity.save.download("png", pngDataUrl, null);
326+
})
327+
}
328+
314329

315330
/**
316331
* Save audio recording in WAV format.

0 commit comments

Comments
 (0)