salvadordf / WebView4Delphi

WebView4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows.
https://www.briskbard.com/forum/
MIT License
280 stars 56 forks source link

Consider synchronous capture preview method #36

Closed jonjbar closed 1 year ago

jonjbar commented 1 year ago

Would you consider a synchronous capture method (as well as a synchronous script execution too) ? This could be done by introducing a TEvent and a timeout in a method which could be named TWVBrowserBase.CapturePreviewSync. Let me know if you need some code to illustrate this request.

salvadordf commented 1 year ago

It's not recommended to lock the user interface while you wait for a browser event.

I would suggest that you use asynchronous browser methods or wait until Microsoft adds support for an off-screen rendering mode to WebView2 to capture a snapshot synchronously.

If your application depends on a synchronous method to capture snapshots and you need to implement it right now then consider using CEF4Delphi because it already supports the off-screen rendering mode.