TButton具有透明的PNG图像和发光的悬停效果 [英] TButton with transparent PNG image and glowing hover effect

查看:116
本文介绍了TButton具有透明的PNG图像和发光的悬停效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Delphi XE,并尝试更新旧的Delphi代码库。该软件最初是用Delphi 7开发的,并使用了由Jonathan Hosking于2001年编写的TPNGButton的黑手版。TPNGButton支持透明和发光的悬停效果。不幸的是,当该项目移植到Delphi XE上时,所有图像都被拉伸以填充整个按钮的区域。

I'm using Delphi XE and trying to update an old Delphi codebase. The software was originally developed with Delphi 7 and used a hacked version of TPNGButton written by Jonathan Hosking in 2001. TPNGButton had a support for transparency and glowing hover effect. Unfortunately when the project was ported on Delphi XE, all the images were stretched to fill the area of the whole button.

我正在尝试创建一种类似的按钮与TButton,但我撞墙。我创建了一个新的测试项目,并添加了带有PNG图像的TButton和TImageList。我将此图像列表添加到按钮的Image属性中,并选择了正确的ImageIndex。这导致按钮的图像正确,但是图像太小(16x16像素)。

I'm trying to create a similar kind of button with TButton but I'm hitting a wall. I created a new test project and added a TButton and a TImageList with PNG image. I added this image list to the Image property of the button and chose the correct ImageIndex. This resulted in a button with the correct image but the image is way too small (16x16 pixels).

我试图通过更改TImageList的大小来解决大小问题。但是之后,即使输入先前的值,我也完全看不到图像。当然,即使是最新版本的Delphi GUI设计器也缺少对撤消的支持,因此我必须删除图像列表并添加新的图像列表以将图像恢复到按钮。

I tried to fix the size issue by changing the size of the TImageList but after this I can't see the image at all even if I enter the previous values. Of course even the most current version of Delphi GUI designer lacks the support for undo so I have to remove the image list and add a new image list to restore the image to the button.

是否有更好的方法来获得我想要的按钮,还是我必须自己编写代码或尝试修复被黑的TPNGButton实现?当然,这不是2011年使用Delphi进行GUI开发的最佳方法吗?

Is there a better way to get the kind of button I want or do I have to code it myself or try to fix the hacked TPNGButton implementation? Surely this can't be the best way for GUI development with Delphi in the year 2011?

推荐答案

TAdvGlowButton 不是免费的,但正是这种按钮。

The TAdvGlowButton is not free, but is exactly this kind of button.

如果您要使用功能区,则 TMS组件包可能值得支付。

The TMS Component pack could be worth paying, if you want a working ribbon.

另请参见 rkGlassButton 。是免费的。

这篇关于TButton具有透明的PNG图像和发光的悬停效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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