niklasvh/html2canvas — Issue #39: Correct way to get base64 "screenshot"?
Author: RVN-BR
Created: 2011-12-09 21:23:30+00:00
State: open

I am trying to get the screenshot into a variable for later manipulation. It is currently working in FF only. Can someone please shed some light or steer me in the correct dir?

thanks!

function takesnap(body){
alert(1); // IE gets here...
var preload = html2canvas.Preload(body, {
"complete": function(images){
alert(10); // in IE doesnt get here....
var queue = html2canvas.Parse(body, images);
var canvas = $(html2canvas.Renderer(queue));
var canvasElement = canvas[0];
var a = canvasElement.toDataURL();
}
});
}
takesnap(document.body);

PS: is this the easiest/best way to get a screenshot into a variable ('a' in this case)...