ImageSource

Namespace: WellFired.Guacamole

Implements: WellFired.Guacamole.Image.IImageSource

Description

Properties

Action< LoadedImage > OnComplete { get; set; }
UIPadding NineSliceDefinition { get; set; }

Public Methods

async Task< LoadedImage > Load ( )
void Cancel ( )
override string ToString ( )

Public Static Methods

IImageSource From ( string location, IFileSystem fileSystem = default(IFileSystem) )
IImageSource From ( string location, UIPadding nineSliceDefinition, IFileSystem fileSystem = default(IFileSystem) )
IImageSource From ( Uri location, IWebRequestHandler webRequestHandler = default(IWebRequestHandler) )
IImageSource From ( Uri location, UIPadding nineSliceDefinition, IWebRequestHandler webRequestHandler = default(IWebRequestHandler) )
IImageSource From ( Stream stream )
IImageSource From ( ImageShape imageShape, double thickness, UIColor color )
IImageSource From ( ImageShape imageShape, double thickness, UIColor color, UIColor outlineColor )

Breakdown

  • UIPadding NineSliceDefinition { get; set; }
  • async Task< LoadedImage > Load ( )

    Description

    Load the image. If loading is cancelled, then the task will most probably returns a null value when cancellation finished.

  • void Cancel ( )

    Description

    Cancel the current loading process. We can cancel our async tasks at any time, but when it is cancelled exactly the task depends on how the different handlers handle the cancellation token.

  • override string ToString ( )
  • IImageSource From ( string location, IFileSystem fileSystem = default(IFileSystem) )

    Description

    The image passed should be a per platform image location, see the documentation for your desired platform for more information.

    Parameters

    location  
    fileSystem An optional IFileSystem can be used if you require custom behaviour
  • IImageSource From ( string location, UIPadding nineSliceDefinition, IFileSystem fileSystem = default(IFileSystem) )

    Description

    The image passed should be a per platform image location, see the documentation for your desired platform for more information. Users can provide Nine Slice Data if needed when loading a texture from disk. I.E. We have a texture of 64 x 64, but decide to slice at (2,2) -> (62, 62), you would use UIPadding.Of(6)

    Parameters

    location  
    nineSliceDefinition  
    fileSystem An optional IFileSystem can be used if you require custom behaviour
  • IImageSource From ( Uri location, UIPadding nineSliceDefinition, IWebRequestHandler webRequestHandler = default(IWebRequestHandler) )

    Description

    Here you can pass a URI to load an image from. Any URI should be valid. Users can provide Nine Slice Data if needed when loading a texture from disk. I.E. We have a texture of 64 x 64, but decide to slice at (2,2) -> (62, 62), you would use UIPadding.Of(6)

    Parameters

    location  
    nineSliceDefinition  
    webRequestHandler An optional IWebRequestHandler can be used if you require custom behaviour
  • IImageSource From ( Stream stream )

    Description

    Load an image from a stream.

    Parameters

    stream
  • IImageSource From ( ImageShape imageShape, double thickness, UIColor color )

    Description

    Loads an Image from a shape definition

    Parameters

    imageShape
    thickness
    color
  • IImageSource From ( ImageShape imageShape, double thickness, UIColor color, UIColor outlineColor )

    Description

    Loads an Image from a shape definition

    Parameters

    imageShape
    thickness
    color
    outlineColor