如何使WebBrowser控件与透明背景? [英] How to make WebBrowser control with transparent background?

查看:1417
本文介绍了如何使WebBrowser控件与透明背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试让我的WebBrowser控件透明,所以如果加载到它的HTML没有背景,底层窗口应该是可见的。
我在尝试不同的方式打破了我的头。

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 Sidebar应用程序中有一个透明的背景。在小工具的HTML< g:background>标签,但是这个标签在通常的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.

我也在DirectX Transform过滤器中调查,可以应用于HTML元素IE,但没有成功。

I`ve also investigate in DirectX Transform filters, which can be applied to the HTML elements in IE, but have no success.

任何帮助将非常感激。

推荐答案

WebBrowser(又名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控件与透明背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆