views:

29

answers:

1

I am creating an instance of AxWebBrowser in a win forms app because I need it to render flash. How can take a screenshot of the page it's rendered in C#?

A: 

Cant you just use

Graphics g = Graphics.FromImage(myImage);
    g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);

.. obviously with the dimensions etc of your window? Never tried it but I cant imagine why it wouldnt work.

pierre
Wouldn't this require an instance of IE to be open in a window. I want to do it behind the scenes which is why I'm using AxWebBrowser
James Alexander