Hi!,
I am an javascript programmer, but beginner at working with the canvas API.
So I made an canvas with multiple images, not only in the viewport but also outside of the canvas.
I want to debug it, check how much pixels they are out of screen etc.
So I thougt I can convert the canvas to png/jpg. to see how big it is and how much extra pixels they use.
I tried but failed:
Uncaught TypeError: Object #<CanvasRenderingContext2D> has no method 'toDataURL'
Code:
Code:
canvasFrame = document.getElementById('imageFrame');
canvas = canvasFrame.getContext('2d');
yepnope("image-editor.js");
var img = game.canvas.toDataURL("image/png");
document.write('<img src="'+img+'"/>');
An other option is to select al the images in the canvas and move it a couple of pixels to determinite the location of them. But I don't know how?
thanks anyway