基于 PNG 图像创建丰富的 UI
当我提供了一组 PNG 图像时,如何在 Delphi 中创建丰富的 UI?我需要使用 PNG 图像为按钮/面板/页面控件“换肤”。 必须支持 PNG 透明度。 有任何组件/解决方案吗?
为了澄清事情: 我不要求典型的“换肤”解决方案,也不要求delphi7中的PNG支持。 而是包含基本控件(按钮、页面控件)并可以设置背景图像的解决方案/组件集/库。 每个元素都会有完全不同的图像,因此这与换肤无关。
How do I create rich UI in Delphi when I'm having set of PNG images provided? I need to "skin" the buttons / panels / page controls with PNG images.
PNG transparency must be supported.
Any components / solutions?
to make things clear:
I'm not asking for typical "skinning" solution, nor for PNG support in delphi7.
Rather for a solution / component set / library which contains basic controls (buttons, page controls) with possibility to set the background image.
Each element will have completely different image, so that is not about skinning.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Delphi 7 中,您将很难做到这一点。最新版本的 Delphi 对 PNG(包括透明度)提供了出色的支持。我知道这不是您问题的简单答案,但我认为这将是最好的解决方案。
You'll have a very hard time doing this in Delphi 7. The latest versions of Delphi have excellent support for PNG including transparency. I know it's not a simple answer to your question but I think it would be the best solution.
自 Delphi 7 以来,我一直在使用 TPngComponents 。它为大多数 delphi 提供了非常好的 png 支持内置/第三方组件。 Embarcadero 购买了另一个众所周知的开源 PNG 支持组件,称为 TPngImage,并在以后的 Delphi 版本中构建到 Delphi 的本机图形支持中。然而,原生的 png 支持似乎更难使用并且有更多问题。请注意,某些组件不支持透明度,因此您必须自己进行一些测试。
通过快速搜索,我还没有找到原始包,但找到了一个主要针对 Delphi 2009/2010 的更新的修改包,但提到“应该兼容到 Delphi 7”,
我自己现在在 Delphi 2010 中使用该版本。
编辑:谢谢Uwe Rabbee 指出 Codegear(现在的 Embarcadero)购买的产品是另一个组件 TPngImage,而不是 这篇文章
I had been using TPngComponents since Delphi 7. That provide very good png support for most of the delphi build-in / third party components. Embarcadero had purchased another well know Open Sources PNG Supporting component know as TPngImage and build into Delphi's native graphic support in later Delphi versions. However, the native png support seems harder to use and had more problems. Notice that some components do not support the transparency so you have to do some test yourselves.
With a fast search, I had not yet find the original package but find a newer modified package mainly for Delphi 2009/2010 but mentioned "should be compatible downto Delphi 7"
I myself am using that version now in Delphi 2010.
edit : Thanks for Uwe Rabbee for pointing out the product Codegear (now Embarcadero) purchased was another component TPngImage rather then the TPngComponent in This Post
我们使用 DevExpress 皮肤库。有了这些组件,就可以用 png 创建您自己的皮肤。但从头开始需要做很多工作...
We use the DevExpress Skinning Library. With these componentes it is possible to create your own skins with png's. But it will be a lot of work to start from scratch...
您可以查看 DelphiAsioVST 库。
这是一个很棒的库,可以帮助您创建音频软件,但它包含可以使用位图的组件,例如转盘或滑块。
对于拨号控件,您可以为每个可能的位置使用一系列图像,以使用户界面如下所示:
You could take a look at the DelphiAsioVST library.
It's an awesome library to help you create audio software, but it contains components where you can use bitmaps, for example for dials or sliders.
For a dial control, you can use series of images for each possible position, to make user interfaces that look like this: