简体   繁体   English

将Canvas绘图保存在html5 phonegap中

[英]save Canvas drawing in html5 phonegap

I have draw drawing on canvas and want to save it as image(jpg/png) on phone internal memory. 我在画布上绘制了图纸,并想将其另存为手机内部存储器中的image(jpg / png)。 How can I do this. 我怎样才能做到这一点。 Any suggestion. 任何建议。

You basically have two choices to do this. 您基本上有两种选择来执行此操作。
1) Use Phonegap filewriter api here 1) 在这里使用Phonegap Filewriter API

2) you can write a custom phonegap plugin, basically send the image data to ios/android and have objective C / java write the image to the filesystem. 2)您可以编写一个自定义phonegap插件,基本上将图像数据发送到ios / android,并使用目标C / java将图像写入文件系统。

Each of these has benefits. 这些都有好处。 I prefer the phonegap plugin, but I have more experience with plugins. 我更喜欢phonegap插件,但是我对插件有更多的经验。 The phonegap api would be quicker though, if your needs are basic. 如果您的需求是基本的,那么phonegap api会更快。 Good Luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM