C# Class FFImageLoading.Work.TaskParameter

Inheritance: IDisposable
显示文件 Open project: daniel-luberda/FFImageLoading Class Usage Examples

Private Properties

Property Type Description
TaskParameter System
TransparencyChannel TaskParameter

Public Methods

Method Description
BitmapOptimizations ( bool enabled ) : TaskParameter
CacheKey ( string customCacheKey ) : TaskParameter

Uses this cache key, in addition with the real key, to cache into memory/disk

Delay ( int milliseconds ) : TaskParameter

Delay the task by the specified milliseconds.

Dispose ( ) : void
DownSample ( int width, int height ) : TaskParameter

Reduce memory usage by downsampling the image. Aspect ratio will be kept even if width/height values are incorrect. Uses pixels units for width/height

DownSampleInDip ( int width, int height ) : TaskParameter

Reduce memory usage by downsampling the image. Aspect ratio will be kept even if width/height values are incorrect. Uses device independent points units for width/height

DownSampleMode ( InterpolationMode mode ) : TaskParameter

Set mode for downsampling. Speed-wise: nearest neighbour > linear > cubic.\ Default: bilinear On Android it's always ignored as Android uses bitmap insamplesize downsampling (bilinear)

DownloadStarted ( Action action ) : TaskParameter

If image starts downloading from Internet this callback is called

Error ( Action action ) : TaskParameter

If image loading failed this callback is called

ErrorPlaceholder ( string filepath, ImageSource source = ImageSource.Filepath ) : TaskParameter

Defines the placeholder used when an error occurs.

FadeAnimation ( bool enabled, bool enabledForCachedImages = null, int duration = null ) : TaskParameter

Indicates if the fade animation should be enabled.

Finish ( Action action ) : TaskParameter

If image loading process finished, whatever the result, this callback is called

FromApplicationBundle ( string filepath ) : TaskParameter

Constructsa new TaskParameter to load an image from a file from application bundle.

FromCompiledResource ( string resourceName ) : TaskParameter

Constructs a new TaskParameter to load an image from a compiled drawable resource.

FromFile ( string filepath ) : TaskParameter

Constructs a new TaskParameter to load an image from a file.

FromStream ( Func stream ) : TaskParameter

Constructs a new TaskParameter to load an image from a stream

FromUrl ( string url, System.TimeSpan cacheDuration = null ) : TaskParameter

Constructs a new TaskParameter to load an image from a URL.

LoadingPlaceholder ( string path, ImageSource source = ImageSource.Filepath ) : TaskParameter

Defines the placeholder used while loading.

Retry ( int retryCount, int millisecondDelay ) : TaskParameter

If image loading fails automatically retry it a number of times, with a specific delay.

Success ( System.Action action ) : TaskParameter

If image loading succeded this callback is called

Success ( LoadingResult>.Action action ) : TaskParameter

If image loading succeded this callback is called

Transform ( IEnumerable transformations ) : TaskParameter
Transform ( ITransformation transformation ) : TaskParameter
TransformPlaceholders ( bool enabled ) : TaskParameter

Indicates if transforms should be applied to placeholders.

WithCache ( CacheType cacheType ) : TaskParameter
WithCustomDataResolver ( IDataResolver resolver ) : TaskParameter

Forces task to use custom resolver.

WithPriority ( LoadingPriority priority ) : TaskParameter

Defines the loading priority, the default is LoadingPriority.Normal

WithPriority ( int priority ) : TaskParameter

Defines the loading priority, the default is 0 (LoadingPriority.Normal)

Private Methods

Method Description
TaskParameter ( ) : System
TransparencyChannel ( bool loadTransparencyChannel ) : TaskParameter

Method Details

BitmapOptimizations() public method

public BitmapOptimizations ( bool enabled ) : TaskParameter
enabled bool
return TaskParameter

CacheKey() public method

Uses this cache key, in addition with the real key, to cache into memory/disk
public CacheKey ( string customCacheKey ) : TaskParameter
customCacheKey string Custom cache key.
return TaskParameter

Delay() public method

Delay the task by the specified milliseconds.
public Delay ( int milliseconds ) : TaskParameter
milliseconds int Milliseconds to wait prior to start the task.
return TaskParameter

Dispose() public method

public Dispose ( ) : void
return void

DownSample() public method

Reduce memory usage by downsampling the image. Aspect ratio will be kept even if width/height values are incorrect. Uses pixels units for width/height
public DownSample ( int width, int height ) : TaskParameter
width int Optional width parameter, if value is higher than zero it will try to downsample to this width while keeping aspect ratio.
height int Optional height parameter, if value is higher than zero it will try to downsample to this height while keeping aspect ratio.
return TaskParameter

DownSampleInDip() public method

Reduce memory usage by downsampling the image. Aspect ratio will be kept even if width/height values are incorrect. Uses device independent points units for width/height
public DownSampleInDip ( int width, int height ) : TaskParameter
width int Optional width parameter, if value is higher than zero it will try to downsample to this width while keeping aspect ratio.
height int Optional height parameter, if value is higher than zero it will try to downsample to this height while keeping aspect ratio.
return TaskParameter

DownSampleMode() public method

Set mode for downsampling. Speed-wise: nearest neighbour > linear > cubic.\ Default: bilinear On Android it's always ignored as Android uses bitmap insamplesize downsampling (bilinear)
public DownSampleMode ( InterpolationMode mode ) : TaskParameter
mode InterpolationMode Optional mode parameter, if not set, defaults to linear.
return TaskParameter

DownloadStarted() public method

If image starts downloading from Internet this callback is called
public DownloadStarted ( Action action ) : TaskParameter
action Action Action.
return TaskParameter

Error() public method

If image loading failed this callback is called
public Error ( Action action ) : TaskParameter
action Action
return TaskParameter

ErrorPlaceholder() public method

Defines the placeholder used when an error occurs.
public ErrorPlaceholder ( string filepath, ImageSource source = ImageSource.Filepath ) : TaskParameter
filepath string Path to the file.
source ImageSource Source for the path: local, web, assets
return TaskParameter

FadeAnimation() public method

Indicates if the fade animation should be enabled.
public FadeAnimation ( bool enabled, bool enabledForCachedImages = null, int duration = null ) : TaskParameter
enabled bool If set to true enabled.
enabledForCachedImages bool Enables animation for local or cached images
duration int Fade animation duration in ms
return TaskParameter

Finish() public method

If image loading process finished, whatever the result, this callback is called
public Finish ( Action action ) : TaskParameter
action Action
return TaskParameter

FromApplicationBundle() public static method

Constructsa new TaskParameter to load an image from a file from application bundle.
public static FromApplicationBundle ( string filepath ) : TaskParameter
filepath string Path to the file.
return TaskParameter

FromCompiledResource() public static method

Constructs a new TaskParameter to load an image from a compiled drawable resource.
public static FromCompiledResource ( string resourceName ) : TaskParameter
resourceName string Name of the resource in drawable folder without extension
return TaskParameter

FromFile() public static method

Constructs a new TaskParameter to load an image from a file.
public static FromFile ( string filepath ) : TaskParameter
filepath string Path to the file.
return TaskParameter

FromStream() public static method

Constructs a new TaskParameter to load an image from a stream
public static FromStream ( Func stream ) : TaskParameter
stream Func Stream.
return TaskParameter

FromUrl() public static method

Constructs a new TaskParameter to load an image from a URL.
public static FromUrl ( string url, System.TimeSpan cacheDuration = null ) : TaskParameter
url string URL to the file
cacheDuration System.TimeSpan How long the file will be cached on disk
return TaskParameter

LoadingPlaceholder() public method

Defines the placeholder used while loading.
public LoadingPlaceholder ( string path, ImageSource source = ImageSource.Filepath ) : TaskParameter
path string Path to the file.
source ImageSource Source for the path: local, web, assets
return TaskParameter

Retry() public method

If image loading fails automatically retry it a number of times, with a specific delay.
public Retry ( int retryCount, int millisecondDelay ) : TaskParameter
retryCount int Number of retries
millisecondDelay int Delay in milliseconds between each trial
return TaskParameter

Success() public method

If image loading succeded this callback is called
public Success ( System.Action action ) : TaskParameter
action System.Action Action to invoke when loading succeded.
return TaskParameter

Success() public method

If image loading succeded this callback is called
public Success ( LoadingResult>.Action action ) : TaskParameter
action LoadingResult>.Action Action to invoke when loading succeded. Argument is the size of the image loaded.
return TaskParameter

Transform() public method

public Transform ( IEnumerable transformations ) : TaskParameter
transformations IEnumerable
return TaskParameter

Transform() public method

public Transform ( ITransformation transformation ) : TaskParameter
transformation ITransformation
return TaskParameter

TransformPlaceholders() public method

Indicates if transforms should be applied to placeholders.
public TransformPlaceholders ( bool enabled ) : TaskParameter
enabled bool If set to true enabled.
return TaskParameter

WithCache() public method

public WithCache ( CacheType cacheType ) : TaskParameter
cacheType CacheType
return TaskParameter

WithCustomDataResolver() public method

Forces task to use custom resolver.
public WithCustomDataResolver ( IDataResolver resolver ) : TaskParameter
resolver IDataResolver Resolver.
return TaskParameter

WithPriority() public method

Defines the loading priority, the default is LoadingPriority.Normal
public WithPriority ( LoadingPriority priority ) : TaskParameter
priority LoadingPriority Priority.
return TaskParameter

WithPriority() public method

Defines the loading priority, the default is 0 (LoadingPriority.Normal)
public WithPriority ( int priority ) : TaskParameter
priority int Priority.
return TaskParameter