I have two buttons, one button creates a canvas with an image. The other buttons converts the canvas to png data (At least, thats what I want to achieve).
The problem is that JavaScript somehow doesn't convert the canvas to image data.
Check jsfiddle here: http://jsfiddle.net/julekker/tjYzw/1/
I've tried to use window.location = finalcanvas.toDataURL("image/png");
and
var img = finalcanvas.toDataURL("image/png");
document.write('<img src="'+img+'"/>');
But they both didn't work.
How can you convert an canvas image which makes use of the drawImage method to png data?