I am not pretty sure the method canvas.toDataURL() returns an encoded
64 base string.I create an png image by mspaint.exe (pic ). The
painting is the same with the one I created on the canvas. I draw
nothing on both of them to ensure they are almost the same.
Then I uploaded the created png file to this site (encoder) to get the
encoded base 64 string,using the pluging provided here(convert base64
string to binary code) to convert it back to the png file. It does
succeed.
But as I check the other string returned by canvas.toDataURL(), I find
the encoded base64 string is quite different from the former one, and
after the convertion, the png file is corrupt. Here are the two 64-
encoded strings:
My question is that is the string returned by canvas.toDataURL("image/
png") really a encoded base-64 string?
Why they look so different... I'm so confused.
Sorry for the long long bothering string.
Simon MacDonald
unread,
Oct 15, 2012, 11:37:41 AM10/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phon...@googlegroups.com
Canvas.toDataUrl() was stubbed out for a long time on Android. I'm not
100% if it is finally fixed in 4.1. Looking at your output it still
seems to be broken.