CefSharp get screenshot of a page

佐手、 提交于 2019-12-13 13:34:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!