问题描述
我尽量让我的WebBrowser控件透明,因此,如果HTML加载到它没有任何的背景下,潜在的窗口应该是可见的。
I`ve打破了我的头尝试不同的方法。
I try to make my WebBrowser control transparent, so if the HTML loaded into it has no background, the underlying window should be visible.I`ve broke my head trying different ways.
有是Microsoft侧边栏应用透明背景。在gadget`s HTML< G:背景>标签可以使用,但是这个标签是不是在平时的WebBrowser控件中可用。
There is a transparent background in Microsoft Sidebar application. In gadget`s HTML <g:background> tag can be used, but this tag is not available in usual webBrowser control.
I`ve还调查在DirectX变换过滤器,其可以应用到在IE HTML元素,但没有成功。
I`ve also investigate in DirectX Transform filters, which can be applied to the HTML elements in IE, but have no success.
任何帮助将大大AP preciated。
Any help would be greatly appreciated.
推荐答案
web浏览器(也称为Internet Explorer)中没有这样的能力。你不得不承载它在使用WS_EX_LAYERED风格的标志和使用SetLayeredWindowAttributes()来使颜色钥匙匹配显示HTML的背景的窗口。避免显示任何文本,它会看起来很糟糕时,抗锯齿像素不再融合与背景的信。
WebBrowser (aka Internet Explorer) has no such capabilities. You'd have to host it in a window that uses the WS_EX_LAYERED style flag and use SetLayeredWindowAttributes() to make the color key match the background of the displayed HTML. Avoid displaying any text, it is going to look bad when the anti-aliasing pixels no longer blend the letter with the background.
这篇关于如何使透明背景WebBrowser控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!