开发者

How can I get a screenshot a the AxWebBrowser instance in C#?

开发者 https://www.devze.com 2022-12-30 17:13 出处:网络
I am creating an instance of AxWebBrowser in a win forms app because I need it to render flash. How can开发者_如何学JAVA take a screenshot of the page it\'s rendered in C#?Cant you just use

I am creating an instance of AxWebBrowser in a win forms app because I need it to render flash. How can开发者_如何学JAVA take a screenshot of the page it's rendered in C#?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号