如何实现Aero的玻璃效果跨平台?
复制:
如果我使用 Winforms 并用它编写一个 win32 应用程序,我可以在 Vista 中看到 Aero 玻璃效果,但在 XP 中看不到。
如何在不同平台上实现相同的外观? 我正在使用 WPF。
顺便问一下,微软是否使用 WPF 编写了 Aero 玻璃效果? 如果是这样,玻璃效果不应该是其他平台上的默认 WPF 外观吗?
Duplicate:
If I use Winforms and I write a win32 application with it, I can see the Aero glass effects in Vista but not in XP.
How could I achieve the same look across different platforms? I am using WPF.
As a side question, did Microsoft write the Aero glass effects using WPF? If so, shouldn't the glass effect be the default WPF look on the other platforms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您指的“空气动力学效应”是什么? 如果您谈论的是窗玻璃,那么恐怕您不走运,因为玻璃效果只能通过 Vista 的桌面窗口管理器实现。
如果您只是寻找窗口透明度、圆角等,那么这在 XP 中当然是可能的。 请参阅本文了解更多信息。
What "Aero effect" are you referring to? If you're talking about the window glass, then I'm afraid you're out of luck, as the glass effect is made possible only through Vista's Desktop Window Manager.
If you're simply looking for window transparency, rounded corners, etc., then this is certainly possible in XP. Check out this article for more information.
好的,所以大部分 DWM 内容都是由一个名为 dwmapi.dll 的 DLL 处理的,它都是在 C++ COM 中,因为这就是 Microsoft 编写其 API 的方式,您可能已经注意到,要调用 API 中的方法,您必须使用一些未编组的布尔类型等,这是因为它必须到达非托管代码,一些需要发生的操作对于 .NET 来说太危险了,无法在不干扰的情况下进行监视,您可能还会注意到所有返回类型实际上都没有返回您将 Vars 作为“out”类型放入,以便代码可以在内存中修改它们,然后可以将该信息读回到您的托管 .NET 代码中。 至于在Windows XP中获得类似效果的方法,我能想到的唯一方法是使用Windows Blinds,然后制作一个带有渐变背景的半透明WPF表单(具有类似玻璃的效果),这将是很容易做到的,但该窗口在 Vista 和 XP 中看起来会很不合适,我认为这不是一个好主意。
希望这有帮助:P
西蒙
Ok, so most of the DWM stuff is handled by a DLL called dwmapi.dll, it is all in C++ COM because that is how Microsoft writes it's APIs, you may have noticed that to call the methods in the API you have to use some unmarshalled boolean types etc, this is because it has to reach unmanaged code, some of the operations that need to take place are too dangerous for .NET to watch over without interfering, you may also notice that all the return types aren't actually returns you put in Vars as "out" types so the code can modify them in memory and then that information can be read back into your managed .NET code. As far as a way to get similar effects in Windows XP, the only way I can think of is using Windows Blinds and then making a translucent WPF form with a gradient background (with a glass like effect) it would be quite easy to do, but the window will look out of place in Vista and XP and I don't think that it is such a good idea.
Hope this helps :P
Simon