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.
精彩评论