-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Transparent background support for WebView2? #2992
Comments
@adambarlow FYI |
This may be something we eventually support, but it will not be supported in WinUI 3. The rendering integration we can currently achieve does not allow a transparent background to properly show rendering from other WinUI elements beneath the WebView2. We'd like to change how this works in the future, which would also allow for transparency, but this will require significant changes in both the Edge WebView2 code and the WinUI code. |
Just maybe a far-fetched idea, but would it be possible to override WebView2's OnPaint() method (if it has any?) and take the WebView2's resulting image and paint a color key (like Chroma key works) with a transparent color or something that Windows sees as transparent? Somewhat like Win98, WinXP and so on managed transparent windows in game installers, WinAmp and so on? Yeah I know I'm talking about WinForms, don't like WPF very much, but maybe it's an idea. Or, another idea: Render WebView2 in a hidden form offscreen to a form that receives that image, puts it into a PictureBox or the form's background and then apply the color key method above? |
Color keys ruin text antialiasing |
When working with UWP apps it is possible for a WebView to set "DefaultBackgroundColor='Transparent'" and receive a WebView with a transparent background. However, in WinUI3 the WebView2 component does not have this property.
So I'm wondering if the WinUI3 WebView2 component supports having a transparent background or if it is something Microsoft will eventually support? And will it then work for both WinUI3 UWP Apps and WinUI3 Desktop Apps?
This question might be related to other issues, but I wasn't sure and couldn't find a post discussing background transparency in WebView2.
The text was updated successfully, but these errors were encountered: