问题
Is it possible to get screenshot of a web page using CefSharp
? I have found information about GetImage()
method but it seems to be not supported anymore. Is there any other way? I need to get screenshots from off-screen browser so making screenshot of a screen with browser displayed is not a solution.
回答1:
I've implemented this feature in a forked branch https://github.com/ivan-sam/CefSharp. This implementation depends on a another commit that fixes script evaluation bug https://github.com/cefsharp/CefSharp/issues/445 , so please clone or download the whole branch.
I've modified CefSharp.Wpf.Example project and added Snapshot button that makes snapshot of the page and opens an image.
If you need to use this feature in WinForms app you can host WPF control with ElementHost
来源:https://stackoverflow.com/questions/24554228/cefsharp-get-screenshot-of-a-page