Open juliancnn opened 7 years ago
Solved.. Solution:
this.download = function (filename) {
if (typeof filename === 'undefined') filename = 'mg.png';
MG.canvas.save().toBlob(function(blob) {
url = URL.createObjectURL(blob);
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
});
Thanks for your amazing job, and sorry for my poor English. Testing the script, I have seen how some browsers (for example chrome) do not support downloading the canvas in image format when it is large. (1080px x 1920px) due to the length of the url.
I have tried to modify it, but I have not succeeded. Some help?
`
this.download = function(filename){ if(typeof filename === 'undefined') filename = 'image.png';