Yevgeniy
Yevgeniy

Reputation: 1066

Transparent Content in Webbrowser

My task is to show HTML content with half-transparent elements in WPF app. Transparency should go through Webbrowser and window. Webbrowser should not be half-transparent itself. So i need a HTML content, and i need to see desktop through it.

Is there any way to do something like that?

Thank you.

P.S.: Sorry for my English.

Upvotes: 5

Views: 6016

Answers (3)

Awesomium and Awesomium.NET is an HTML UI Engine that supports just that.

Check the WPF WebControl. You can set WebControl.IsTransparent to true, and load some content with say body { background-color: transparent; } (you can even specify a custom CSS to be applied to all loaded pages, using WebSession).

Upvotes: 3

KF2
KF2

Reputation: 10153

The WPF Web Browser control is technically a wrapped WinForms WebBrowser Control, so it is rendered in the WinForms layer, which is always above the WPF layer.you can use Awesomium.NET Browser instead IE Browser or convert your Html code to Xmal code and show in Flow Document control.WPF Flow Document For Beginners

Upvotes: 1

Peter Holmes
Peter Holmes

Reputation: 652

This isn't currently possible; this is due to the way that the Web Browser control is rendered. It isn't really a true WPF control but a WPF wrapper around a COM component. This limits the functionality available and also causes other problems, such as the lack of ability to float WPF controls over the top of it.

I believe there is a new WebView control coming for Windows 8.1 apps (demoed at Build 2013). This may provide more flexibility, although I'm not sure if this is a Windows 8.1 app thing or whether it will also be available to WPF apps as part of .NET 4.5.1.

Upvotes: 2

Related Questions