为什么我在 Delphi 2009 功能区中使用的透明图像在运行时不透明?
我刚刚使用了新的 Delphi 2009 功能区,向其中添加了一些页面、组和操作客户端(大按钮)。 我在 Photoshop 中创建了一些透明的 32x32px PNG,并将它们放入 TImageList(设置为 cd32bit)中。 我将此列表添加到 Actionmanager 的 Images 属性中,以在按钮上显示它们。 在设计时,功能区中的图标看起来很好,但在编译和启动应用程序时,它们具有黑色背景。 知道是什么原因造成的以及如何解决这个问题吗? 我不想创建以功能区颜色作为背景的图像,因为那时我无法切换到功能区的其他颜色集。
提前致谢 马克
I just played around with the new Delphi 2009 ribbon, added a few pages, groups and actionclients (large buttons) to it. I created some transparent 32x32px PNGs in Photoshop and put them into a TImageList (set to cd32bit). I added this list to the Actionmanager's Images property, to show them on the buttons.
At designtime the icons in the ribbon look just fine, but when compiling and starting the app they have a black background.
Any idea what causes this and how I can fix this? I do not want to create the images with the ribbon color as background, because I cannot switch to another colorset of the ribbon then.
Thanks in advance
Marc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保应用程序主题已启用:项目 > 选项> 应用>> 启用运行时主题。
您是否尝试过将 Imagelist 的 DrawingStyle 属性设置为 dsTransparent?
Ensure that Application theme is enabled by: Project > Options > Application > Enable runtime theme.
Have you tried to set the DrawingStyle property of Imagelist to dsTransparent?
答案很晚,但也许对某人有帮助。
我遇到了同样的问题,穆罕默德的建议仍然没有解决它。
事实证明,您还必须将 TImageList.ColorDepth 设置为 cd32Bit。
默认情况下,它设置为
cdDeviceDependent
。Very late answer, but maybe it helps someone.
I had the same problem, and Mohammed's suggestion still didn't fix it.
It turns out you also have to set
TImageList.ColorDepth
tocd32Bit
.By default it's set to
cdDeviceDependent
.