C# 使用SkinSharp皮肤库

时间:2016-10-07 17:33:21   收藏:0   阅读:1988

SkinSharp 不同于其他任何换肤库,仅以标准的动态链接库形式存在,所以在使用时,无需进行系统注册。

文件说明:

SkinH_Net.dll SkinSharp换肤引擎, 标准的动态链接库

SkinH_CS.dll SkinSharp引用类库

skinh.she SkinSharp默认皮肤

 

现以最基本Attach()接口演示如何用一句代码进行换肤。其他接口可以参考官网的文档中心。

Attach()接口默认加载程序当前目录下的skinh.she文件进行换肤。

 

1. 创建C#.Net Windows应用程序

2. 拷贝软件包Bin目录中的SkinSharp相关文件 (SkinH_Net.dl SkinH_CS.dll skinh.she)到程序输出目录下

3. 添加接口类库SkinH_CS.dll的引用

ps:在解决方案那里找到引用=》右键=》添加引用=》选择SkinH_CS.dll

4. 为达到完美效果,需要将视觉样式选项去掉,在Program.cs 文件的Main函数中将启用视觉样式的代码注释

//Application.EnableVisualStyles();

5. 添加换肤代码

using SkinSharp;

namespace SkinSharp_Demo
{
    public partial class Form1 : Form
    {
        public SkinH_Net skin;
        public Form1()
        {
            skin = new SkinH_Net();
            skin.Attach();
            InitializeComponent();
        }

 

参数说明

Attach();//加载运行目录下的skinh.she

AttachEx("皮肤路径", "");//加载指定目录下的she皮肤

AttachRes(Properties.Resources.storm, Convert.ToUInt32(Properties.Resources.storm.Length), "", 0, 0, 0);//加载资源中的皮肤,其中的storm即为添加的资源文件,不需要添加she后缀

 

原文:http://www.cnblogs.com/testsec/p/5936236.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!