Z.IconLibrary.dll的使用

Z.IconLibrary.dll的使用

 

一.在web方面的应用

1. 在Web.Config文件中添加以下

<system.web>

    <httpHandlers>

      <add path="*/z.axd"verb="*" type="Z.IconLibrary.IconResourceHandler"validate="false" />

    </httpHandlers>

 </system.web>

 

 <system.webServer>

    <handlers>

      <addname="Z.IconLibrary.RessourceHandler" verb="*"path="*/z.axd" preCondition="integratedMode"type="Z.IconLibrary.IconResourceHandler" />

    </handlers>

 </system.webServer>


2. 在page中引用Z.IconLibrary.dll, 添加using Z.IconLibrary;

3. 在Page_Load中添加如下代码即可:

 protectedvoid Page_Load(object sender, EventArgs e)
 {
            Page.AddIconStyleSheet();

}

 

Label添加图片如下:16表示16位

 [LabelID].CssClass= Icon.Accept.GetCssClass16(); // required web.config setup
[LabelID].CssClass = Icon.Accept.GetCssClass32(); // required web.config setup


Image添加图片如下
[ImageID].ImageUrl= Icon.Accept.GetUrl16(); // required web.config setup
[ImageID].ImageUrl = Icon.Accept.GetUrl32(); // required web.config setup


 

二 在WinForm中使用

1.    此处需要注意版本的添加。我用上面dll在VS2008, VS2010中均提示【无法定义到导航】,所以只要在网上下载

C# Icon Library adds thousands of icons toany kind of project (Web, WinForm, Etc.). All Icons have been designed by aprofessionals.

-------------------------------------------------

 

FarmFresh 16x16 & 32x32 (3926 icons)

CodePlex:https://ziconlibraryfarmfresh.codeplex.com/releases

NuGet:https://www.nuget.org/packages/Z.IconLibrary.FarmFresh/

 

-------------------------------------------------

FarmFresh 16x16 (3926 icons)

CodePlex: https://ziconlibraryfarmfresh16.codeplex.com/releases

NuGet:https://www.nuget.org/packages/Z.IconLibrary.FarmFresh16/

 

-------------------------------------------------

FarmFresh 32x32 (3926 icons)

CodePlex:https://ziconlibraryfarmfresh32.codeplex.com/releases

NuGet:https://www.nuget.org/packages/Z.IconLibrary.FarmFresh32/

 

-------------------------------------------------

Fugue 16x16 (3570 icons)

CodePlex:https://ziconlibraryfugue.codeplex.com/releases

NuGet:https://www.nuget.org/packages/Z.IconLibrary.Fugue/

 

-------------------------------------------------

Silk 32x32 (1000 icons)

CodePlex: https://ziconlibrarysilk.codeplex.com/releases

NuGet:https://www.nuget.org/packages/Z.IconLibrary.Silk/

2.    引用文件 usingZ.IconLibrary.Silk;

3.    代码如下:

           uiImage16.Image = Z.IconLibrary.Silk.Icon.Accept.GetImage();

           uiIcon16.Image = Z.IconLibrary.Silk.Icon.Accept.GetIcon().ToBitmap();

           uiBitmap16.Image = Z.IconLibrary.Silk.Icon.Accept.GetBitmap();

           using (var stream = Z.IconLibrary.Silk.Icon.Accept.GetStream())

           {

                uiStream16.Image = newSystem.Drawing.Bitmap(stream);

           }

其范例可参考:http://jonathanmagnan.com/icon-library-winform-examples/

如在Button上添加控件:代码如下: 

            button1.Image =Z.IconLibrary.FarmFresh.Icon.Add.GetBitmap32();

            button1.ImageAlign =System.Drawing.ContentAlignment.MiddleLeft;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值