Something like the following:
<canvas id="canv" width="500" height="500"> </canvas>
<input type="submit" value="Download Canvas" onclick="download();"/>
function download () {
var canvas = document.getElementById("canv");
var dataURL = toDataURL(canvas);
//Download code here:
}
What is the required code to initiate a download of the image?