0

I have an app on the iphone which will display on the screen an html file containing text and an image. I manipulate this html file with javascript and when I'm done I would like the user to be able to take a screen shot but would like it to be done automatically, without pressing the home and power buttons. Is the some javascript or jQuery that, once the final screen is displayed on the phone, automatically takes a screen shot and places it into the photo library on the phone? Thanks.

4

1 回答 1

0

简短的回答:不。更长的回答:有点,但不是真的。

据我所知,你不能让 iOS 截屏,甚至不能通过 Javascript 或类似的方式下载图像。但是,我想您可以尝试在画布中绘制 DOM,然后使用canvas.toDataURL()( link ) 将其转换为图像。然后,您可以指示用户在图像上按住手指以调出保存对话框并将其保存到他们的设备中。

正如我所说,这并不是一个非常好的解决方案,但如果你真的需要这个功能,也许你可以尝试一下。

编辑:我做了一个快速的谷歌搜索,发现这个 javascript 库应该可以更容易地完成我上面描述的操作。

于 2013-11-12T01:14:23.447 回答