I´m using HTML2canvas, filesaver.js and canvas2blob.js to achieve an in-browser save-dialogue. The on-the-fly canvas-creation and saving works fine except the image background is black.
The problem is the base64-encoded image of the div with id="drop1" (the user drags and drops an image from his desktop to the html and then that image is put as background as base64).
How can I achieve a visible output in the png file?
my JS:
// save img magic
// html2canvas.js linked with filesaver.js and canvas2blob.js for compatibility polyfilling
$('#1stSave').click(function() {
var html2obj = html2canvas($('#drop1'));
var queue = html2obj.parse();
var canvas = html2obj.render(queue);
canvas.toBlob(function(blob) {
saveAs(blob, "teaser-384x168px.png");
});
});
Thanks so much in advance :)