toDataURL not working on android browsers

前端 未结 3 1698
再見小時候
再見小時候 2020-12-18 05:34

I have an image that the user drew on a canvas and i want to save that image on the server.

These lines work well on my ipad but not on my android(ver 2.3.3) browser

相关标签:
3条回答
  • 2020-12-18 06:22

    Unfortunately toDataURL() only work on android 3.2 or above version.

    0 讨论(0)
  • 2020-12-18 06:25

    Unfortunately it isn't supported in your version (i think it's only supported in ICS), have a look at this issue reported

    http://code.google.com/p/android/issues/detail?id=16829

    There is supposed to be some sort of JavaScript implementation to add support for it, but i haven't tried it myself

    http://code.google.com/p/todataurl-png-js/

    0 讨论(0)
  • 2020-12-18 06:26

    An alternative implementation that we have used successfully on multiple Android handsets without modification is described in this blog post:

    http://jimdoescode.blogspot.co.uk/2011/11/trials-and-tribulations-with-html5.html

    This uses the toDataURL method if it works correctly, and if not uses a javascript jpg encoding library to produce the image.

    0 讨论(0)
提交回复
热议问题