本文介绍了在PhoneGap中将路径/ URL保存到相机胶卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将图片从PhoneGap中的路径/网址保存到相机胶卷?
How can i save a image to the camera roll from a path/URL in PhoneGap?
例如:
canvas=document.getElementsByTagName('canvas')[0]
ctx=canvas.getContext()
ctx.drawRect(100,100,200,200)
url=canvas.toDataURL()
saveToCameraRoll(url) // Saving to camera roll
推荐答案
如果你想从一个画布到保存到iOS中的相机胶卷,我写了一个插件就是这样。
If you wish to go from a canvas to saving to the camera roll in iOS, I have written a plugin that does just that.
p>
https://github.com/devgeeks/Canvas2ImagePlugin
canvas2ImagePlugin.saveImageDataToLibrary(win, fail, 'myCanvasID');
这篇关于在PhoneGap中将路径/ URL保存到相机胶卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!