在IE中本地保存画布 [英] saving canvas locally in IE

查看:267
本文介绍了在IE中本地保存画布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在IE中本地保存画布。

Hi I want to save a canvas locally in IE.

  var img = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");

我无法通过以下方式下载。

I couldn't manage to download it with following ways.

1) document.execCommand("SaveAs"..
2) window.location.href = img;
3) $.fileDownload(img);  // jquery download file library-
4) canvas2image // cross domain problem.

有没有办法在IE中本地保存画布没有base64或跨域问题?非常感谢。

Is there a way to save canvas locally in IE without base64 or cross domain problem? Thank you very much.

推荐答案

好吧,看起来这在IE中不起作用,列出它,我将提供一个例子。此操作使用 HTML5 下载属性在这里更多),并允许用户点击链接

Well, it looks like this doesn't work in IE either, but since you've not listed it, I'll provide an example. This uses the HTML5 download attribute (more here), and allows the user to click a link which then downloads a file.

<a href="data:text/html;base64,PCF...." download="file.png"></a>

这篇关于在IE中本地保存画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆