将 Canvas dataURL 保存为 .png 文件(通过应用程序发布在 Facebook 墙上)

发布于 2024-11-05 17:13:27 字数 222 浏览 7 评论 0原文

我有一个小的 Facebook 应用程序,我希望能够将我的画布内容发布到某人的墙上,如果他们在保存图像数据后选择的话。

当按下保存按钮时,我会得到一个 dataURL,其中包含我想要发布到用户墙上的图像数据。我相信唯一的方法是将数据保存为 .png,然后将其张贴在墙上。我正在查看 dataURL 文档,但没有看到任何方法可以轻松地将 dataURL 输出为 .png 文件,以便我可以将其发布。最好的方法是什么?

I have a little Facebook application and I would like to be able to post the contents of my canvas onto someone's wall if they so choose after they save their image data.

When the save button is pressed I get a dataURL that contains the image data I would like to post onto the user's wall. I believe the only way to do this would be to save the data as .png and then post this on the wall. I was looking through the dataURL documentation and I did not see any way to easily output the dataURL as a .png file so that I can post it. What would be the best way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文