static/js/control.js
/**
 * Take a screenshot and export as a PNG image.
 * @function exportPNG
 * @param {Object} canvas - canvas DOM to export
 */
Take a screenshot and export as a PNG image.
@function exportPNG
@param {Object} canvas - canvas DOM to export
Take a screenshot and export as a PNG image . @function exportPNG @param { Object } canvas - canvas DOM to export
function exportPNG(canvas) {
  var a = document.createElement('a');
  a.href = canvas.toDataURL('image/png');
  a.download = 'image.png';
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
}
function exportPNG ( canvas ) { var a = document . createElement ( 'a' ) ; a . href = canvas . toDataURL ( 'image/png' ) ; a . download = 'image.png' ; document . body . appendChild ( a ) ; a . click ( ) ; document . body . removeChild ( a ) ; }
Take a screenshot and export as a PNG image.
Take a screenshot and export as a PNG image .