开发中需要在silverlight中使用GIF格式的图片,网搜,方法有几种,试了试,感觉比较方便的一种是:http://www.cnblogs.com/allanli/archive/2012/04/02/2429871.html#2469708 介绍的第二种。但是这个写的不是很详细,后来发现是dll不止一个。把自己用的过程记录一下
1.从网站上下载Imagetools.dll。刚开始以为这一个就够了,后来发现,还必须下载其他dll
从http://imagetools.codeplex.com/ 下载整个Imagetool的文件夹,其中bin/ 文件夹下的sl4适用。从sl4里面找到想用的和GIF相关的dil:
Imagetools.dll
Imagetools.Control.dll
Imagetools.Filtering.dll
Imagetools.IO.GIF.dll 这个一定要有,png和bmp用到再说
imagetools.Util.dll
将这些dll添加到代码文件夹下的bin,并添加引用
xmlns:Gif="clr-namespace:Imagetools.Controls;assembly=Imagetools.Controls"
<Gif:AnimatedImage x:Name="newGif" Width="25" Source =" {Binding ImageSource}/> 3.后台代码 using Imagetools; ExtendedImage image = new ExtendedImage(); image.UriSource = new Uri("/XXX/Images/newimg.gif",UriKind.RelativeOrAbsolute); this.newGif.source = image;
1.从网站上下载Imagetools.dll。刚开始以为这一个就够了,后来发现,还必须下载其他dll
从http://imagetools.codeplex.com/ 下载整个Imagetool的文件夹,其中bin/ 文件夹下的sl4适用。从sl4里面找到想用的和GIF相关的dil:
Imagetools.dll
Imagetools.Control.dll
Imagetools.Filtering.dll
Imagetools.IO.GIF.dll 这个一定要有,png和bmp用到再说
imagetools.Util.dll
将这些dll添加到代码文件夹下的bin,并添加引用
xmlns:Gif="clr-namespace:Imagetools.Controls;assembly=Imagetools.Controls"
<Gif:AnimatedImage x:Name="newGif" Width="25" Source =" {Binding ImageSource}/> 3.后台代码 using Imagetools; ExtendedImage image = new ExtendedImage(); image.UriSource = new Uri("/XXX/Images/newimg.gif",UriKind.RelativeOrAbsolute); this.newGif.source = image;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。