# ImageSource

public final class ImageSource

Helper class used to set the source and additional attributes from a variety of sources. Supports use of a bitmap, asset, resource, external file or any other URI.

When you are using a preview image, you must set the dimensions of the full size image on the ImageSource object for the full size image using the dimensions method.

## Functions

asset
Link copied to clipboard
public static ImageSource asset(String assetName)
Create an instance from an asset name.
bitmap
Link copied to clipboard
public static ImageSource bitmap(Bitmap bitmap)
Provide a loaded bitmap for display.
cachedBitmap
Link copied to clipboard
public static ImageSource cachedBitmap(Bitmap bitmap)
Provide a loaded and cached bitmap for display.
dimensions
Link copied to clipboard
public ImageSource dimensions(int sWidth, int sHeight)
Declare the dimensions of the image.
region
Link copied to clipboard
public ImageSource region(Rect sRegion)
Use a region of the source image.
resource
Link copied to clipboard
public static ImageSource resource(int resId)
Create an instance from a resource.
tiling
Link copied to clipboard
public ImageSource tiling(boolean tile)
Enable or disable tiling of the image.
tilingDisabled
Link copied to clipboard
public ImageSource tilingDisabled()
Disable tiling of the image.
tilingEnabled
Link copied to clipboard
public ImageSource tilingEnabled()
Enable tiling of the image.
uri
Link copied to clipboard
public static ImageSource uri(Uri uri)
public static ImageSource uri(String uri)
Create an instance from a URI.