问题
I saw a thread here suggesting using a HPA to take a browser screenshot, but I was wondering if you could help me. I would like to be able to select a part of a piece of a web page and render it as an image. I know flex can take images of its own canvas, but is it possible to take a picture of the rest of the page?
I would like to be able to do it with just flash and javascript, and without a plugin. I realise that I may be asking for magic, so thanks for your help.
回答1:
If Flex can do it, then Flash should also be able to do it.
Doing it client side is if nothing else, rather unreliable. Personally I would go for either an external service like http://snapcasa.com/ or if you have access to your server go for a server side solution like http://khtml2png.sourceforge.net/
回答2:
I would say, for security reasons, it would be impossible for you to take a snapshot of the browser itself.
But, you should be able to read the HTML, and then use the Browser component in Flash to display that HTML, then take a screenshot of that. I don't think it'd be as easy as that, but take a look at this post for as a start: Flex.html
来源:https://stackoverflow.com/questions/1462461/snapshot-from-browser-with-flash-or-javascript