Oops. Original answer was specific to a similar question. This has been revised:
var canvas = document.getElementById("mycanvas");
var img = canvas.toDataURL("image/png");
with the value in IMG you can write it out as a new Image like so:
document.write('<img src="'+img+'"/>');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…