C# Класс FFImageLoading.Drawables.SelfDisposingBitmapDrawable

A BitmapDrawable that uses reference counting to determine when internal resources should be freed (Disposed). On Android versions Honeycomb and higher the internal Bitmap is Dispose()d but not recycled. On all other Android versions the Bitmap is recycled then disposed.
Наследование: Android.Graphics.Drawables.BitmapDrawable, ISelfDisposingBitmapDrawable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
monitor object

Private Properties

Свойство Тип Описание
CheckState void

Открытые методы

Метод Описание
SelfDisposingBitmapDrawable ( ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Android.Graphics.Bitmap bitmap ) : Android.Content.Res
SelfDisposingBitmapDrawable ( IntPtr handle, JniHandleOwnership transfer ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, Android.Graphics.Bitmap bitmap ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, Stream stream ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, string filePath ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Stream stream ) : Android.Content.Res
SelfDisposingBitmapDrawable ( string filePath ) : Android.Content.Res
SetIsCached ( bool isCached ) : void

This should only be called by caching entities. Increments or decrements the cache reference count. This count represents if the instance is cached by something and should not free its resources when no longer displayed.

SetIsDisplayed ( bool isDisplayed ) : void

This should only be called by Views that are actually going to draw the drawable. Increments or decrements the internal displayed reference count. If the internal reference count becomes 0, NoLongerDisplayed will be raised. If the internal reference count becomes 1, Displayed will be raised. This method should be called from the main thread.

SetIsRetained ( bool isRetained ) : void

If you wish to use the instance beyond the lifecycle managed by the caching entity call this method with true. But be aware that you must also have the same number of calls with false or the instance and its resources will be leaked. Also be aware that once retained, the caching entity will not allow the internal Bitmap allocation to be reused. Retaining an instance does not guarantee it a place in the cache, it can be evicted at any time.

SetNoLongerDisplayed ( ) : void

Защищенные методы

Метод Описание
OnFreeResources ( ) : void

Приватные методы

Метод Описание
CheckState ( ) : void

Описание методов

OnFreeResources() защищенный Метод

protected OnFreeResources ( ) : void
Результат void

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( ) : Android.Content.Res
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Android.Graphics.Bitmap bitmap ) : Android.Content.Res
bitmap Android.Graphics.Bitmap
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( IntPtr handle, JniHandleOwnership transfer ) : Android.Content.Res
handle System.IntPtr
transfer JniHandleOwnership
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Resources resources ) : Android.Content.Res
resources Resources
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Resources resources, Android.Graphics.Bitmap bitmap ) : Android.Content.Res
resources Resources
bitmap Android.Graphics.Bitmap
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Resources resources, Stream stream ) : Android.Content.Res
resources Resources
stream Stream
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Resources resources, string filePath ) : Android.Content.Res
resources Resources
filePath string
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( Stream stream ) : Android.Content.Res
stream Stream
Результат Android.Content.Res

SelfDisposingBitmapDrawable() публичный Метод

public SelfDisposingBitmapDrawable ( string filePath ) : Android.Content.Res
filePath string
Результат Android.Content.Res

SetIsCached() публичный Метод

This should only be called by caching entities. Increments or decrements the cache reference count. This count represents if the instance is cached by something and should not free its resources when no longer displayed.
public SetIsCached ( bool isCached ) : void
isCached bool If set to true is cached.
Результат void

SetIsDisplayed() публичный Метод

This should only be called by Views that are actually going to draw the drawable. Increments or decrements the internal displayed reference count. If the internal reference count becomes 0, NoLongerDisplayed will be raised. If the internal reference count becomes 1, Displayed will be raised. This method should be called from the main thread.
public SetIsDisplayed ( bool isDisplayed ) : void
isDisplayed bool If set to true reference count is /// incremented, otherwise it is decremented.
Результат void

SetIsRetained() публичный Метод

If you wish to use the instance beyond the lifecycle managed by the caching entity call this method with true. But be aware that you must also have the same number of calls with false or the instance and its resources will be leaked. Also be aware that once retained, the caching entity will not allow the internal Bitmap allocation to be reused. Retaining an instance does not guarantee it a place in the cache, it can be evicted at any time.
public SetIsRetained ( bool isRetained ) : void
isRetained bool If set to true is retained.
Результат void

SetNoLongerDisplayed() публичный Метод

public SetNoLongerDisplayed ( ) : void
Результат void

Описание свойств

monitor защищенное свойство

protected object monitor
Результат object