public final class ImageSource extends Object
dimensions(int, int)
method.Modifier and Type | Method and Description |
---|---|
static ImageSource |
asset(String assetName)
Create an instance from an asset name.
|
static ImageSource |
bitmap(Bitmap bitmap)
Provide a loaded bitmap for display.
|
static ImageSource |
cachedBitmap(Bitmap bitmap)
Provide a loaded and cached bitmap for display.
|
ImageSource |
dimensions(int sWidth,
int sHeight)
Declare the dimensions of the image.
|
protected Bitmap |
getBitmap() |
protected Integer |
getResource() |
protected int |
getSHeight() |
protected Rect |
getSRegion() |
protected int |
getSWidth() |
protected boolean |
getTile() |
protected Uri |
getUri() |
protected boolean |
isCached() |
ImageSource |
region(Rect sRegion)
Use a region of the source image.
|
static ImageSource |
resource(int resId)
Create an instance from a resource.
|
ImageSource |
tiling(boolean tile)
Enable or disable tiling of the image.
|
ImageSource |
tilingDisabled()
Disable tiling of the image.
|
ImageSource |
tilingEnabled()
Enable tiling of the image.
|
static ImageSource |
uri(String uri)
Create an instance from a URI.
|
static ImageSource |
uri(Uri uri)
Create an instance from a URI.
|
public static ImageSource resource(int resId)
resId
- resource ID.ImageSource
instance.public static ImageSource asset(String assetName)
assetName
- asset name.ImageSource
instance.public static ImageSource uri(String uri)
uri
- image URI.ImageSource
instance.public static ImageSource uri(Uri uri)
uri
- image URI.ImageSource
instance.public static ImageSource bitmap(Bitmap bitmap)
bitmap
- bitmap to be displayed.ImageSource
instance.public static ImageSource cachedBitmap(Bitmap bitmap)
bitmap
- bitmap to be displayed.ImageSource
instance.public ImageSource tilingEnabled()
public ImageSource tilingDisabled()
public ImageSource tiling(boolean tile)
tile
- whether tiling should be enabled.public ImageSource region(Rect sRegion)
sRegion
- the region of the source image to be displayed.public ImageSource dimensions(int sWidth, int sHeight)
sWidth
- width of the source image.sHeight
- height of the source image.protected final Uri getUri()
protected final Bitmap getBitmap()
protected final Integer getResource()
protected final boolean getTile()
protected final int getSWidth()
protected final int getSHeight()
protected final Rect getSRegion()
protected final boolean isCached()