How to programatically take snapshot of browser rendered image in JavaScript?
I have an image rendered by browser. I want to provide a functionality to my clients wherein they can just click a button and the JavaScript code should take the snapshot of the screen image (Screen) and prompt the users with "Save As" option. I am using IE.
Can anyone 开发者_高级运维kindly help me with this?
You won't be able to do that with plain javascript due to security restrictions (imagine if a site could take a snapshot of your banking details).
Since you mentioned that you are targeting Internet Explorer, you can do it with an ActiveX control as mentioned in this answer: Take a screenshot of a webpage with javascript?.
Alternatively, you can use a java applet as mentioned in this answer: How can you get a screenshot from someone's web browser?
精彩评论