Coder Social home page Coder Social logo

thuytrinh / jet-image-loader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artem-zinnatullin/jet-image-loader

1.0 2.0 0.0 2.54 MB

WP7+ fast and powerfull image loader with memory and storage caching for your projects!

License: Apache License 2.0

jet-image-loader's Introduction

JetImageLoader load, cache, show, do it again!

Fast and powerful image loader with memory and storage caching for your Windows Phone 7+ projects!

(Many ideas were taken from UniversalImageLoader for Android)

####Like a boss:

  • Load images
  • Cache them in memory
  • Cache them on storage
  • Do it asynchronously

sample screenshot

##Why JetImageLoader is super?##

####0) It was created to work as Converter! Look:

<Image Source="{Binding YourImageUri, Converter={StaticResource MyAppJetImageLoaderConverter}}"/>

#####WOW, yeah? Super awesome!

##How to add && configure JetImageLoader in your project?

  1. Easy to add to your project and start using it in only 4 simple steps:
  • 1.1) Add reference to JetImageLoader.dll or use nuget: PM> Install-Package WP-JetImagLoader
  • 1.2) Extend JetImageLoaderConverter and configure it:
    public class MyAppJetImageLoaderConverter : BaseJetImageLoaderConverter
    {
        protected override JetImageLoaderConfig GetJetImageLoaderConfig()
        {
            return new JetImageLoaderConfig.Builder
            {
                IsLogEnabled     = true,
                CacheMode        = CacheMode.MemoryAndStorageCache,
                DownloaderImpl   = new HttpWebRequestDownloader(),
                MemoryCacheImpl  = new WeakMemoryCache(),
                StorageCacheImpl = new LimitedStorageCache(IsolatedStorageFile.GetUserStoreForApplication(), 
                                   "\\image_cache", new SHA1CacheFileNameGenerator(), 1024 * 1024 * 10), // == 10 MB
            }.Build();
        }
    }
  • 1.3) Declare MyAppJetImageLoaderConverter in App.xaml:
    ````
    
    
    ...````
  • 1.4) Set it as Converter for Image:
    ````````

aaand that is all, now it can load images from network, cache them in memory and storage and then load them from cache!

  1. You can use your own implementations:
    Downloader implementation    — just implement IDownloader interface
    Memory cache implementation  — just extend BaseMemoryCache abstract class
    Storage cache implementation — just extend BaseStorageCache abstract class
  1. JetImageLoader already has basic implementations for all this things:
    1 Downloader implemetation      — HttpWebRequestDownloader based on HttpWebRequest class
    1 Memory cache implementation   — WeakMemoryCache based on WeakRefDictionary with weak references
                                     and auto GC cleaning (very cool)
    2 Storage cache implementations — LimitedStorageCache with configurable limit in bytes to store on disk
                                     and stupid UnlimitedStorageCache implementation

####NuGet: PM> Install-Package WP-JetImagLoader

jet-image-loader's People

Contributors

artem-zinnatullin avatar rahulpnath avatar nearga avatar

Stargazers

Media Explorer avatar

Watchers

James Cloos avatar Thuý 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.