Git Product home page Git Product logo

imagelib.uwp's Introduction

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

imagelib.uwp's People

Contributors

chenrensong avatar

Watchers

James Cloos avatar Fang Peng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.