1

I'm in the process of writing Flex (ActionScript 3.0) application that runs in a browser.

One of the requirements is to be able to take a screenshot of currently displayed content, but not limited to the SWF object's area but the whole active tab.

In Chrome I've resolved the issue by coding an extension. First I make a request from inside of the Flex app using ExternalInterface class then in extension itself I communicate with background script and take a screenshot there using chrome.tabs.captureVisibleTab() which is automatically converted to a String format which I am able to pass back to callback function in SWF object.

In Firefox I have used a similar approach - browser extension that talks back and forward with Flex app using JavaScript allows me to procure screen capture.

In Internet Explorer I'm stuck at the very beginning. I don't exactly know how to approach the issue. I've read about ActiveX controls and BHOs:

But since I'm a beginner in Microsoft technologies I really could use some help with picking best approach to the problem.

In short my question is: How do I pass the screenshot of a currently active tab in IE to a Flex application?

Community
  • 1
  • 1
  • BHO would be the way to go – Jaromanda X Dec 07 '15 at 13:36
  • If you have php installed on the site then you could also consider **[imagegrabwindow](http://php.net/manual/en/function.imagegrabwindow.php)**. Their example code is specifically for Internet Explorer on Windows. If you also **echo** the result image then on the Flash side you'd just use usual image loading code (ex: to php url instead of some jpg url). – VC.One Dec 07 '15 at 15:24

1 Answers1

0

Why not capture the screenshot in javascript and send it over to your swf?

Community
  • 1
  • 1
sfxworks
  • 1,031
  • 8
  • 27
  • I've investigated the solution you're suggesting, HTML2Canvas isn't exactly capturing the screenshot but rather randering html content in a container and retreiving bitmap data of that container. It might seem like the same thing but unfortunately it's not. Very often the site is rendered way differently than when being displayed to the user and I need to capture, with 100% accuracy, what is being seen by the user. – Michał Kujawski Dec 08 '15 at 08:04
  • http://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript [HTA](https://msdn.microsoft.com/en-us/library/ms536471(vs.85).aspx)?... Can't exactly and use [Clipboard](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/Clipboard.html) since it it makes a bitmap, becuase bitmap format is only for AIR applications, but it might help you along the lines of somehow pairing it with Active X. I don't know myself though, sorry. – sfxworks Dec 08 '15 at 11:21