如何制作一个可换肤的应用程序?
具体来说,我想知道音乐播放器Muziic是如何换肤的。 面板中的图像框是否会根据皮肤中的 XML 内容而变化? 我该如何在 C# 或 C++ 中做这样的事情?
Specifically, I want to know how the music player Muziic is skinnable. Is it just image boxes in a panel that change depending on what the XML in the skin says? And how would I do something like this in C# or C++?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最基本的想法是您将拥有某种用户可编辑的配置文件。 该文件可以规定诸如用于按钮/界面的纹理之类的内容,甚至可能控制位置。
当您的应用程序加载时,您将读取配置并相应地设置属性。
这在某种程度上取决于您的应用程序需要做什么,以及您需要提供什么级别的换肤性
The very basic idea is that you would have some sort of user-editable configuration file. This file could dictate things like textures to use for buttons/interfaces, or possibly even control positions.
when your app loads, you read the configuration, and set the properties accordingly.
It sort of depends on what your application needs to do, and what level of skinnability you need to provide
我还没有得到答案,但我想我会让你知道我在寻找同样的东西时遇到的一个网站。
看看 Componentfactory.com。
您可以下载免费的控件工具包,允许您自定义其外观和感觉。 可以使用称为调色板的东西动态更改外观和感觉,调色板指定每个控件的绘制方式(具有公共主题)。
他们有一个非常有用的论坛,可以回答有关自定义代码以及供您自己使用的外观和感觉的问题。
源代码也可以以较低的价格获得,并且可以为您自己的工作提供灵感。
我已经使用这个工具包创建了多个应用程序,作为 C# 的相对新手,在截止日期前完成它被证明非常有帮助。 最终我想对控件的设计进行更多的控制 - 然而该工具包做得相当好,并且可能需要很多时间来匹配。
I've not got the answer but thought i'd let you know about a website that I came across when seaching for the same thing.
Take a look at Componentfactory.com.
You can download a free toolkit of controls that allow you to customise their look and feel. The look and feel can be changed dynamically using something called a palette which specifies how each control is drawn (with a common theme).
They have a very helpful forum answering questions on customising the code and the look and feel for your own use.
The source code is also available for a small price and may provide inspriation for your own work.
I have used this toolkit to create several applications and as relative novice in C# with deadlines to meet it has proved very helpful. Eventually I would like to take more control over the design of the controls - however the toolkit is pretty well done and would probably take a lot of time to match.