98
rated 0 times
[
99]
[
1]
/ answers: 1 / hits: 19282
/ 9 Years ago, thu, november 19, 2015, 12:00:00
I want to save the Fabric canvas as an image (jpg or png is the same) on the pc, by clicking on a button in my html page. I tried a solution but doesn't work:
function saveF(canvF) {
var imageCanv = canvF.toDataURL('png');
var myBlob = new Blob(['imageCanv'], { type: image/png });
var reader = new FileReader();
reader.onload = function (event) {
var URL = canvF.toDataURL('png');
document.getElementById(lnkDownload).href = URL;
};
reader.readAsDataURL(myBlob);}
This is the html tag :
<a class=icon fb href= id=lnkDownload download=canvas.png style=float:left; background-color:red><i class=fa fa-save></i></a>
i founded other solutions but they didn't work
More From » html