public class ImageLoaderUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
IMAGE_DIR |
| Constructor and Description |
|---|
ImageLoaderUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
cleanUpFileDirectory() |
protected static java.io.File |
createImageFile(Context context,
java.lang.String fileName) |
static Bitmap |
getImageBitmap(java.lang.String uri)
This method gives you the bitmap of the image you tell it to load from the filesystem.
|
static java.lang.String |
saveImageFromAssetDir(Context context,
java.lang.String filePath)
Use this to save the image if the image exists in your assets directory.
|
static java.lang.String |
saveImageFromDrawable(Context context,
int resourceId,
java.lang.String name)
Use this to save the image if the image is a drawable.
|
static java.lang.String |
savePrintableImage(Context context,
Bitmap bitmap,
java.lang.String fileName)
Use this to save the image if you already have a bitmap generated to print.
|
public static final java.lang.String IMAGE_DIR
public static Bitmap getImageBitmap(java.lang.String uri)
uri - The file location.public static java.lang.String saveImageFromAssetDir(Context context,
java.lang.String filePath)
context - The activity context.filePath - Path to the asset in your assets directory.ImageAsset.public static java.lang.String saveImageFromDrawable(Context context,
int resourceId,
java.lang.String name)
context - The activity context.resourceId - Resource ID.name - Name of the file you want to save as.ImageAsset.public static java.lang.String savePrintableImage(Context context,
Bitmap bitmap,
java.lang.String fileName)
context - The activity context.bitmap - The bitmap.fileName - Name of the file you want to save as.ImageAsset.protected static java.io.File createImageFile(Context context,
java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionprotected static void cleanUpFileDirectory()