views:

10

answers:

1

I need to write method which returns Image for passed URL or HTML.

Am using WebBroser control to get screenshot, only problem is I am capturing screenshot at documentcompleted event, and I could not do this in single function say 'GetBrowserScreenshot(string html)' cause this event is getting fired asyc (this is what I think).

How to wait for this event to get complete in single method where I am creating WebBrowser control and get the screenshot.

A: 

Use a wait handle such as AutoResetEvent, this way you can wait for the async event to complete on its own thread...

see here or here

Richard Friend