开发者

Android - Save HTML 5 Canvas to png

I have a webapp that uses an HTML 5 canvas to allow the user to draw.

I need to save this to the sdcard as a png.

I can get the base64 by using .toDataURL() but I can't figure out how to use that to save the file.

I am using开发者_如何转开发 Phonegap, not sure if that can be used to help.

Or maybe I could pass the data to Java and do it from there, but I'm not that familiar with Java.


try Canvas2Image lib http://www.nihilogic.dk/labs/canvas2image/


I wrote a similar thing: https://github.com/jimdoescode/jqScribble

Included in that repo is a PHP script for saving the base64 data as an actual image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜