You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application I use 2 process architecture where main process does not have network access and second process uses CEF to render webcontent into a shared memory region from where main app can read the pixels. I am wondering if I can achieve this using webview2
Currently this is not possible. We have offscreen rendering on our backlog, and are tracking it in #20, but I think this ask is clearer so I'll also add this issue to our item. Thanks!
Unfortunately not yet. We have not begun work on this yet. This is a large amount of work, and while very high on our priority list, gets bumped each quarter as higher priority asks come in. I really want to do this work as it's currently one of our top asks, but the earliest that could happen is Q1 2022 at this point.
Reacted by Niklas Schulze, AndyHai, Fabian Terhorst, Isaque Neves, Leon B., Yannbcf, Artem Dzhemesiuk, Dominik, Robert Wallis, Alex and 3 more
We are currently using CefSharp to render into an offscreen buffer that is sent to an FPGA to be composited onto a live video feed. The render includes playback of MPEG4-encoded video. We were looking into using WebView because CefSharp's default Chromium build does not include the MPEG4 codec. But without offscreen rendering, that's a moot point. We've since produced our own custom build of Chromium to include the codec.
We need access to the web rendered textures so that we can warp and blend multiple images to projector outputs to create a clear seamless view on the inside of a cylinder or room.
This is unsatisfactory because it uses the deprecated custom compositing (which could be removed in future) instead of skia and is difficult to keep updated.
We would look at moving to webview2 if access to the rendered textures could be provided and supported along with the ability to include proprietary codecs
Thanks for the info Richard Jackson (@rjx-ray)! If you don't need high-frequency rendering you could consider using the CapturePreview function to get an image, but this isn't great for things like videos or other animations.
We are starting on the design phase of this work. Would you mind sharing your use case so that we can consider it in our plans?
Game UI development, specifically within DirectX 9 (Ex) / 10 / 11 contexts.
Ability to render into an offscreen texture and display that as overlay of the game.
Reacted by YotPhiligan, Shelley Lake, Justin S, David Huculak, Michael Mahgu, Valerian G., Artem Dzhemesiuk, BitsE9, Jeff Hutchinson, Yannbcf and 22 more
We are starting on the design phase of this work. Would you mind sharing your use case so that we can consider it in our plans?
Currently, we utilize CefSharp Offscreen for generating a PDF from HTML content or using it to generate screenshots of HTML in a server side environment.
Vladimir Ikryanov (@vladimir-ikryanov) The problem I have right now is that I am actually using a lib for Flutter that uses WebView2 inside, at this moment the selects do not work and according to the developer is because of the lack of this functionality.
By any chance do you have any recommendation, it would be VERY useful indeed.
scalveerne Flutter doesn't use native Windows widgets to display UI. It just renders UI. So, all the buttons, labels, tables, are just pictures. When that lib embeds and displays a WebView2 control inside a Flutter window, the WebView2 is embedded as a child HWND native window. In this case you should observe that you cannot display Flutter message dialogs on top of WebView2. It's because Flutter cannot render its UI on top of a third-party native window that is displayed on top of Flutter's canvas where all the UI controls are rendered.
By default, WebView2 should display the drop-down popups (selects) using its own functionality. In general, WebView2 will just ask Chromium (WebView2 uses Chromium underhood) to create and display the popup at specific location on screen. WebView2 should tell Chromium the locations of the WebView on screen, so that Chromium could locate the popup relatively.
I suppose the lib, that embeds WebView2 inside a Flutter window, doesn't provide this info to WebView2 -> Chromium. That's why Chromium cannot display the drop-down popups (maybe it's displayed, but somewhere out of the screen or at 0x0 of the screen). Maybe WebView2 doesn't provide an API that the developer of the lib can use to do this. Maybe that's what they mean by "the lack of this functionality".
Anyway, this issue can be solved only by the developer of the lib that allows embedding WebView2 inside Flutter. I don't know any possible way to fix or workaround this behavior outside the lib or inside your Flutter code. Sorry about that 🙁.
Vladimir Ikryanov (@vladimir-ikryanov) There were some concepts that I was not clear and thanks to your comment I think I understand them better, I will try to touch some things in the bookstore in the hope that something will change, I thank you very much for your comment, it was VERY useful and productive for me and my product.
+1. Kicking this as it’s highly requested and could also improve my life.
Reacted by czw299, waparabka, jheraldP, Dimethylbiguanide Difrax, Bobby Cannon, lurenjiamax, Merlin Schumacher, bwedding, Andrey Nekrasov, klofi and 4 more
#547 (comment)
Can this be done with the win32 API somehow?
Im thinking like, you create a window using CreateWindowEx & attach a webview to it using CreateCoreWebView2EnvironmentWithOptions ... then somehow read pixels directly from the window - without having to rely on any framework like winrt?
#547 (comment) Can this be done with the win32 API somehow?
Im thinking like, you create a window using CreateWindowEx & attach a webview to it using CreateCoreWebView2EnvironmentWithOptions ... then somehow read pixels directly from the window - without having to rely on any framework like winrt?
I did this in C++/Win32 or WinUI 3 C# +P/Invoke with COM interfaces (ICoreWebView2CompositionController and so on).
But it was just to capture/draw a bitmap from Visual (with GDI and CreateDIBSection)
It can be more complicated for live rendering (must be done with GPU, otherwise too slow...)
I will have to try to check if GraphicsCaptureItem + Direct2D can be used...
I will have to try to check if GraphicsCaptureItem + Direct2D can be used...
I tested with Direct2D and Direct3D (with IDirect3DDxgiInterfaceAccess to get Texture or Surface then ID2D1Bitmap1) in WinUI3 C# and it seems to work correctly.
Test with Google page on a classic rotating cube in Direct3D 11 with a SwapChainPanel (animation is smoother than in the GIF, although not perfect on my old PC (no real GPU)) :
I uploaded a test sample in WinUI 3 C# + P/Invoke (like C++/Win32) : WinUI3_SwapChainPanel_WebView2
by getting, from captured frames, ID2D1Bitmap1 for Direct2D or ID3D11Texture2D for Direct3D or other
I uploaded a test sample in WinUI 3 C# + P/Invoke (like C++/Win32) : WinUI3_SwapChainPanel_WebView2 by getting, from captured frames, ID2D1Bitmap1 for Direct2D or ID3D11Texture2D for Direct3D or other
This is interesting! Although I am not sure if the frames of the browser is synchronized to the frames of requestAnimationFrame() for synchronized animations in the browser.
Are you wiling to assign a permissive source code license such as MIT or Apache to it?
This is interesting! Although I am not sure if the frames of the browser is synchronized to the frames of requestAnimationFrame() for synchronized animations in the browser.
Are you wiling to assign a permissive source code license such as MIT or Apache to it?
I did not test with requestAnimationFrame; I can get a correct result (no dropped frames) on my old/slow PC with Microsoft.UI.Dispatching.DispatcherQueueTimer, although a thread should be used with other frameworks (not easy in WinUI 3 with classic RPC_E_WRONG_THREAD error without DispatcherQueue.TryEnqueue)
All the code examples I upload in my repository can be copied/pasted or improved; I usually post them to answer questions on GitHub or Microsoft forums (previously (on Usenet, MSDN), I used to link to .zip files, but I was told that it was more practical and sustainable to upload code with GitHub now...)
Activity
champnic commentedon Oct 20, 2020
Currently this is not possible. We have offscreen rendering on our backlog, and are tracking it in #20, but I think this ask is clearer so I'll also add this issue to our item. Thanks!
Harvey3141 commentedon Oct 10, 2021
Hi, do you have any updates on this which you're able to share?
champnic commentedon Oct 11, 2021
Unfortunately not yet. We have not begun work on this yet. This is a large amount of work, and while very high on our priority list, gets bumped each quarter as higher priority asks come in. I really want to do this work as it's currently one of our top asks, but the earliest that could happen is Q1 2022 at this point.
avail commentedon Apr 8, 2022
Any news on this?
champnic commentedon Apr 8, 2022
We are starting on the design phase of this work. Would you mind sharing your use case so that we can consider it in our plans?
doxxx commentedon Apr 8, 2022
We are currently using CefSharp to render into an offscreen buffer that is sent to an FPGA to be composited onto a live video feed. The render includes playback of MPEG4-encoded video. We were looking into using WebView because CefSharp's default Chromium build does not include the MPEG4 codec. But without offscreen rendering, that's a moot point. We've since produced our own custom build of Chromium to include the codec.
rjx-ray commentedon Apr 13, 2022
Our use case is to show web content in our immersive VR spaces. See https://www.igloovision.com/software/enterprise-package/igloo-web
We need access to the web rendered textures so that we can warp and blend multiple images to projector outputs to create a clear seamless view on the inside of a cylinder or room.
Currently we use CEF for the web input with a user maintained patch for getting the shared textures. See https://bitbucket.org/chromiumembedded/cef/pull-requests/285 and read down to the end of the comments for full details. We build CEF with proprietary codecs included. The builds of our app and CEF are done with C++.
This is unsatisfactory because it uses the deprecated custom compositing (which could be removed in future) instead of skia and is difficult to keep updated.
We would look at moving to webview2 if access to the rendered textures could be provided and supported along with the ability to include proprietary codecs
champnic commentedon Apr 13, 2022
Thanks for the info Richard Jackson (@rjx-ray)! If you don't need high-frequency rendering you could consider using the CapturePreview function to get an image, but this isn't great for things like videos or other animations.
rjx-ray commentedon Apr 13, 2022
Hi Nic Champagne Williamson [MSFT] (@champnic), thanks for the response but we do need high-frequency rendering, typically for YouTube and other web video display.
avail commentedon Apr 17, 2022
Game UI development, specifically within DirectX 9 (Ex) / 10 / 11 contexts.
Ability to render into an offscreen texture and display that as overlay of the game.
jcain82 commentedon May 11, 2022
Currently, we utilize CefSharp Offscreen for generating a PDF from HTML content or using it to generate screenshots of HTML in a server side environment.
117 remaining items
scalveerne commentedon Mar 26, 2025
Vladimir Ikryanov (@vladimir-ikryanov) The problem I have right now is that I am actually using a lib for Flutter that uses WebView2 inside, at this moment the selects do not work and according to the developer is because of the lack of this functionality.
By any chance do you have any recommendation, it would be VERY useful indeed.
vladimir-ikryanov commentedon Apr 2, 2025
scalveerne Flutter doesn't use native Windows widgets to display UI. It just renders UI. So, all the buttons, labels, tables, are just pictures. When that lib embeds and displays a WebView2 control inside a Flutter window, the WebView2 is embedded as a child HWND native window. In this case you should observe that you cannot display Flutter message dialogs on top of WebView2. It's because Flutter cannot render its UI on top of a third-party native window that is displayed on top of Flutter's canvas where all the UI controls are rendered.
By default, WebView2 should display the drop-down popups (selects) using its own functionality. In general, WebView2 will just ask Chromium (WebView2 uses Chromium underhood) to create and display the popup at specific location on screen. WebView2 should tell Chromium the locations of the WebView on screen, so that Chromium could locate the popup relatively.
I suppose the lib, that embeds WebView2 inside a Flutter window, doesn't provide this info to WebView2 -> Chromium. That's why Chromium cannot display the drop-down popups (maybe it's displayed, but somewhere out of the screen or at 0x0 of the screen). Maybe WebView2 doesn't provide an API that the developer of the lib can use to do this. Maybe that's what they mean by "the lack of this functionality".
Anyway, this issue can be solved only by the developer of the lib that allows embedding WebView2 inside Flutter. I don't know any possible way to fix or workaround this behavior outside the lib or inside your Flutter code. Sorry about that 🙁.
scalveerne commentedon Apr 2, 2025
Vladimir Ikryanov (@vladimir-ikryanov) There were some concepts that I was not clear and thanks to your comment I think I understand them better, I will try to touch some things in the bookstore in the hope that something will change, I thank you very much for your comment, it was VERY useful and productive for me and my product.
whiskets commentedon Jun 17, 2025
Is off-screen rendering available for WebView2?
right now l use cefsharp + opengl
e-m-hh-com commentedon Sep 2, 2025
Is there a roadmap for this functionality or will it never be available?
or75 commentedon Sep 15, 2025
is there any progress on this issue?
gabereiser commentedon Oct 13, 2025
+1. Kicking this as it’s highly requested and could also improve my life.
bwedding commentedon Dec 5, 2025
Nic Champagne Williamson [MSFT] (@champnic) This was in April 2022. Any progress in the last 3-1/2 years?
ItsCubeTime commentedon Jan 7, 2026
#547 (comment)
Can this be done with the win32 API somehow?
Im thinking like, you create a window using CreateWindowEx & attach a webview to it using CreateCoreWebView2EnvironmentWithOptions ... then somehow read pixels directly from the window - without having to rely on any framework like winrt?
castorix commentedon Jan 8, 2026
I did this in C++/Win32 or WinUI 3 C# +P/Invoke with COM interfaces (ICoreWebView2CompositionController and so on).
But it was just to capture/draw a bitmap from Visual (with GDI and CreateDIBSection)
It can be more complicated for live rendering (must be done with GPU, otherwise too slow...)
I will have to try to check if GraphicsCaptureItem + Direct2D can be used...
castorix commentedon Jan 9, 2026
I tested with Direct2D and Direct3D (with IDirect3DDxgiInterfaceAccess to get Texture or Surface then ID2D1Bitmap1) in WinUI3 C# and it seems to work correctly.
Test with Google page on a classic rotating cube in Direct3D 11 with a SwapChainPanel (animation is smoother than in the GIF, although not perfect on my old PC (no real GPU)) :
castorix commentedon Jan 19, 2026
I uploaded a test sample in WinUI 3 C# + P/Invoke (like C++/Win32) : WinUI3_SwapChainPanel_WebView2
by getting, from captured frames, ID2D1Bitmap1 for Direct2D or ID3D11Texture2D for Direct3D or other
mdrejhon commentedon Jan 19, 2026
This is interesting! Although I am not sure if the frames of the browser is synchronized to the frames of requestAnimationFrame() for synchronized animations in the browser.
Are you wiling to assign a permissive source code license such as MIT or Apache to it?
castorix commentedon Jan 20, 2026
I did not test with requestAnimationFrame; I can get a correct result (no dropped frames) on my old/slow PC with Microsoft.UI.Dispatching.DispatcherQueueTimer, although a thread should be used with other frameworks (not easy in WinUI 3 with classic RPC_E_WRONG_THREAD error without DispatcherQueue.TryEnqueue)
All the code examples I upload in my repository can be copied/pasted or improved; I usually post them to answer questions on GitHub or Microsoft forums (previously (on Usenet, MSDN), I used to link to .zip files, but I was told that it was more practical and sustainable to upload code with GitHub now...)