Skip to content

支持Universal Windows Platform(UWP),基于微软最新的2d图形加速引擎Win2d,支持gif、jpg、png、webp等格式

Notifications You must be signed in to change notification settings

terry-dai/ImageLib.UWP

 
 

Repository files navigation

ImageLib.UWP

NuGet Version

支持Universal Windows Platform(UWP),基于微软最新的2d图形加速引擎Win2d,支持gif、jpg、png、webp等格式。 同时支持实现IImageDecoder接口来支持更多图片格式。

初始化

  ImageLoader.Initialize(new ImageConfig.Builder()
            {
                CacheMode = ImageLib.Cache.CacheMode.MemoryAndStorageCache,
                MemoryCacheImpl = new LRUCache<string, IRandomAccessStream>(),
                StorageCacheImpl = new LimitedStorageCache(ApplicationData.Current.LocalCacheFolder,
                "cache", new SHA1CacheGenerator(), 1024 * 1024 * 1024)
            }.AddDecoder<GifDecoder>().AddDecoder<WebpDecoder>().Build(), false);

XAML代码

 <controls:ImageView 
           Margin="0,20"
           UriSource="ms-appx:///Images/2.gif"
           Stretch="None"/>

自定义ImageLoader

  ImageLoader.Register("test", new ImageConfig.Builder()
            {
                CacheMode = ImageLib.Cache.CacheMode.MemoryAndStorageCache,
                MemoryCacheImpl = new LRUCache<string, IRandomAccessStream>(),
                StorageCacheImpl = new LimitedStorageCache(ApplicationData.Current.LocalFolder,
                "cache1", new SHA1CacheGenerator(), 1024 * 1024 * 1024)
            }.AddDecoder<GifDecoder>().AddDecoder<WebpDecoder>().Build());
 <controls:ImageView 
           ImageLoaderKey="test"
           UriSource="ms-appx:///Images/2.gif"
           Stretch="None"/>

##支持URI格式 http:, https:, ms-appx:,ms-appdata:,ms-resource; ##支持平台 Client: Windows 10

Server: Windows Server 2016

Phone: Windows 10 ##开发工具 Visual Studio 2015 ##Nuget

PM> Install-Package ImageLib.UWP

About

支持Universal Windows Platform(UWP),基于微软最新的2d图形加速引擎Win2d,支持gif、jpg、png、webp等格式

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 76.3%
  • C 15.5%
  • C# 7.6%
  • Other 0.6%