为什么我在 Delphi 2009 功能区中使用的透明图像在运行时不透明?

发布于 2024-07-25 23:48:31 字数 308 浏览 2 评论 0原文

我刚刚使用了新的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

靑春怀旧 2024-08-01 23:48:31
  1. 确保应用程序主题已启用:项目 > 选项> 应用>> 启用运行时主题。

  2. 您是否尝试过将 Imagelist 的 DrawingStyle 属性设置为 dsTransparent?

  1. Ensure that Application theme is enabled by: Project > Options > Application > Enable runtime theme.

  2. Have you tried to set the DrawingStyle property of Imagelist to dsTransparent?

深空失忆 2024-08-01 23:48:31

答案很晚,但也许对某人有帮助。

我遇到了同样的问题,穆罕默德的建议仍然没有解决它。
事实证明,您还必须将 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 to cd32Bit.

By default it's set to cdDeviceDependent.

Object Inspector

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文