伊谢尔伦2017-04-11 12:54:20
https://developer.mozilla.org...
var canvas = document.getElementById("canvas");
canvas.toBlob(function(blob) {
var formData = new FormData();
formData.append('img', blob, 'canvas.jpg');
//然后把这个formData扔给ajax就好了。babababa
});
canvas内容保存成文件以及压缩图片相关的api