问题
I make an application canvas. I load more image (png, gif) in canvas. When I click print on my browser (opera), the contents of the canvas tag does not print. With other browsers (FF, IE, Chrome), there is no problem. Why?
回答1:
this answer from Capture HTML Canvas as gif/jpg/png/pdf? might be useful.
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+'"/>');
来源:https://stackoverflow.com/questions/8031016/printing-the-contents-of-the-canvas-tag