C# Class FFImageLoading.Cache.ImageCache

Inheritance: IImageCache
Mostra file Open project: daniel-luberda/FFImageLoading

Public Methods

Method Description
Add ( string key, ImageInformation imageInformation, ISelfDisposingBitmapDrawable bitmap ) : void
Add ( string key, ImageInformation imageInformation, WriteableBitmap bitmap ) : void
Clear ( ) : void
Get ( string key ) : ImageInformation>.Tuple
Get ( string key ) : ImageInformation>.Tuple
GetBitmapDrawableFromReusableSet ( Android.Graphics.BitmapFactory options ) : ISelfDisposingBitmapDrawable

Attempts to find a bitmap suitable for reuse based on the given dimensions. Note that any returned instance will have SetIsRetained(true) called on it to ensure that it does not release its resources prematurely as it is leaving cache management. This means you must call SetIsRetained(false) when you no longer need the instance.

GetBitmapSize ( Android.Graphics.Drawables.BitmapDrawable bmp ) : int
GetInfo ( string key ) : ImageInformation
Remove ( string key ) : void
RemoveSimilar ( string baseKey ) : void

Private Methods

Method Description
CleanAbandonedItems ( ) : void
GetCacheSizeInPercent ( float percent ) : int

Gets the memory cache size based on a percentage of the max available VM memory.

GetMaxCacheSize ( int maxCacheSize ) : int
ImageCache ( int maxCacheSize, IMiniLogger logger, bool verboseLogging ) : Android.Graphics
ImageCache ( int maxCacheSize, IMiniLogger logger ) : FFImageLoading.Concurrency

Method Details

Add() public method

public Add ( string key, ImageInformation imageInformation, ISelfDisposingBitmapDrawable bitmap ) : void
key string
imageInformation ImageInformation
bitmap ISelfDisposingBitmapDrawable
return void

Add() public method

public Add ( string key, ImageInformation imageInformation, WriteableBitmap bitmap ) : void
key string
imageInformation ImageInformation
bitmap WriteableBitmap
return void

Clear() public method

public Clear ( ) : void
return void

Get() public method

public Get ( string key ) : ImageInformation>.Tuple
key string
return ImageInformation>.Tuple

Get() public method

public Get ( string key ) : ImageInformation>.Tuple
key string
return ImageInformation>.Tuple

GetBitmapDrawableFromReusableSet() public method

Attempts to find a bitmap suitable for reuse based on the given dimensions. Note that any returned instance will have SetIsRetained(true) called on it to ensure that it does not release its resources prematurely as it is leaving cache management. This means you must call SetIsRetained(false) when you no longer need the instance.
public GetBitmapDrawableFromReusableSet ( Android.Graphics.BitmapFactory options ) : ISelfDisposingBitmapDrawable
options Android.Graphics.BitmapFactory Bitmap creation options.
return ISelfDisposingBitmapDrawable

GetBitmapSize() public static method

public static GetBitmapSize ( Android.Graphics.Drawables.BitmapDrawable bmp ) : int
bmp Android.Graphics.Drawables.BitmapDrawable
return int

GetInfo() public method

public GetInfo ( string key ) : ImageInformation
key string
return ImageInformation

Remove() public method

public Remove ( string key ) : void
key string
return void

RemoveSimilar() public method

public RemoveSimilar ( string baseKey ) : void
baseKey string
return void