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.
|
@NonNull public static ImageSource resource(int resId)
resId
- resource ID.ImageSource
instance.@NonNull public static ImageSource asset(@NonNull String assetName)
assetName
- asset name.ImageSource
instance.@NonNull public static ImageSource uri(@NonNull String uri)
uri
- image URI.ImageSource
instance.@NonNull public static ImageSource uri(@NonNull Uri uri)
uri
- image URI.ImageSource
instance.@NonNull public static ImageSource bitmap(@NonNull Bitmap bitmap)
bitmap
- bitmap to be displayed.ImageSource
instance.@NonNull public static ImageSource cachedBitmap(@NonNull Bitmap bitmap)
bitmap
- bitmap to be displayed.ImageSource
instance.@NonNull public ImageSource tilingEnabled()
@NonNull public ImageSource tilingDisabled()
@NonNull public ImageSource tiling(boolean tile)
tile
- whether tiling should be enabled.@NonNull public ImageSource region(Rect sRegion)
sRegion
- the region of the source image to be displayed.@NonNull 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()