在 Delphi 中淡入 alpha 混合 PNG 表单
几年前,当 Vista 首次发布时,我曾问过这个问题,但始终没有解决这个问题,并把它搁置起来,留待以后考虑。
我有一个启动屏幕,我花了很大力气让它看起来很棒。 这是 32bpp alpha 混合的 PNG。 我有一些代码(如果需要,我可以挖掘它们!),当桌面组合关闭时,它们在 Windows XP 或 Vista+ 下工作得很好。 然而,在Vista+下,所有透明部分都是黑色的,破坏了它看起来很棒的一切!
所以,我的问题是这样的:任何人都能够以激活和不激活桌面合成的方式将 32bpp alpha 混合的 PNG 显示为启动屏幕吗? 如果需要,无论免费还是其他方式,我并不反对使用第三方组件。
理想情况下,这可以在 Delphi 7 中工作。
更新:除了下面的答案非常有效之外,我发现 TMS TAdvSmoothSplashScreen 组件也可以很好地处理此任务,尽管稍微复杂一些。
I asked a question about this some years back when Vista was first released, but never resolved the problem and shelved it as something to consider later.
I have a splash screen that I went to great effort to make look great. It's a 32bpp alpha-blended PNG. I have some code (which I can dig up if required!) that works great under Windows XP or under Vista+ when desktop composition is turned off. However, under Vista+ all the transparent parts are black, destroying everything that looks great about it!
So, my question is this: as anyone been able to display a 32bpp alpha-blended PNG as a splash screen in a way that works both with and without desktop composition activated? I'm not adverse to using third-party components if required, free or otherwise.
Ideally, this would work in Delphi 7.
Update: Besides the answers below, which work very well, I found that the TMS TAdvSmoothSplashScreen component also handles this task very well, if somewhat more complex.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Bob S 链接的文章给出了正确的答案。 由于该文章包含您实际需要的相当多的额外信息,因此这是我通过它创建的表单/单元(请注意,您将需要 GraphicEx 库 从这里:
The article Bob S links to gives the correct answer. Since that article contains quite a bit extra information that you actually need, here is the form/unit I create through it (Note that you'll need the GraphicEx library from here:
蒂姆,我刚刚在 Vista/D2007 上尝试了这个,选择了“Windows Classic”主题:
Alpha Blended Splash Screen in Delphi - 第 2 部分
http://melander.dk/articles/alphasplash2/2/
没有我可以的黑色背景瞧……看起来还是很棒的。
Tim, I just tried this on Vista/D2007 with 'Windows Classic' theme selected:
Alpha Blended Splash Screen in Delphi - Part 2
http://melander.dk/articles/alphasplash2/2/
no black background that I could see... it still looks great.