public class BitmapFactoryUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.HashMap<java.lang.Integer,android.os.MemoryFile> |
memoryFileHashMap |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkIsJpegResource(int resourceID)
Check if the resource is a jpeg file, by looking at the file_extension
|
static boolean |
checkIsPngResource(int resourceID)
Check if the resource is a jpeg file, by looking at the file_extension
|
static boolean |
checkIsSvgResource(int resourceID)
Check if the raw resource is a svg file, by looking at the file_extension
|
static boolean |
checkResourceType(int resourceID,
java.lang.String[] suffixs)
Check if the resource is a jpeg file, by looking at the file_extension
|
static android.graphics.Bitmap |
decodeFile(java.lang.String filename,
int minSize,
boolean square)
Decode a image file into a Bitmap.
|
static android.graphics.Bitmap |
decodeFile(java.lang.String filename,
int minSize,
boolean square,
boolean fixRotation)
Decode a image file into a Bitmap.
|
static android.graphics.Bitmap |
decodeResource(android.content.res.Resources res,
int resId)
Decode a drawable or a raw image resource.
|
static android.graphics.Bitmap |
decodeResource(android.content.res.Resources res,
int resId,
int minSize)
Decode a drawable or a raw image resource.
|
static android.graphics.Bitmap |
decodeResourceSlice(java.io.File file,
int sampleSize,
android.graphics.Rect region) |
static android.graphics.Bitmap |
decodeResourceSlice(android.content.res.Resources res,
int resId,
int sampleSize,
android.graphics.Rect region) |
static float[] |
decodeSize(java.io.InputStream stream) |
static float[] |
decodeSize(android.content.res.Resources res,
int resId) |
static float[] |
decodeSize(java.lang.String filename) |
static android.graphics.Bitmap |
decodeStream(java.io.InputStream stream,
int minSize)
Decode a drawable or a raw image resource.
|
static android.graphics.Bitmap |
decodeStreamSlice(java.io.InputStream inputStream,
int sampleSize,
android.graphics.Rect region)
Decode a chunk of a raw image resource.
|
static android.graphics.Bitmap |
drawResource(android.content.res.Resources res,
int resId,
int width,
int height)
Draw a XML Drawable resource to a Bitmap because a XML Drawable not can be decoded by #decodeResource
|
static int |
getImageRotation(java.lang.String filename)
Get the orientation of the image file base on the exif information.
|
static void |
preloadResource(android.content.res.Resources res,
int resId) |
public static java.util.HashMap<java.lang.Integer,android.os.MemoryFile> memoryFileHashMap
public static android.graphics.Bitmap decodeFile(java.lang.String filename,
int minSize,
boolean square)
filename - image file path.minSize - minWidth the image must have.square - width and height of the image should be same.public static android.graphics.Bitmap decodeFile(java.lang.String filename,
int minSize,
boolean square,
boolean fixRotation)
filename - image file path.minSize - minWidth the image must have.square - width and height of the image should be same.fixRotation - fix image rotation based on the exif orientation information.public static int getImageRotation(java.lang.String filename)
filename - image file path.public static android.graphics.Bitmap decodeResource(android.content.res.Resources res,
@DrawableRes @RawRes
int resId,
int minSize)
res - resources @see #ImgLySdk.getAppResource().resId - resource id.minSize - minWidth the image must have.public static android.graphics.Bitmap decodeStream(java.io.InputStream stream,
int minSize)
throws java.io.IOException
stream - image inputStreamminSize - minWidth the image must have.java.io.IOExceptionpublic static android.graphics.Bitmap decodeStreamSlice(java.io.InputStream inputStream,
int sampleSize,
android.graphics.Rect region)
throws java.io.IOException
inputStream - image inputStream.sampleSize - sub sample size.java.io.IOExceptionpublic static android.graphics.Bitmap decodeResourceSlice(java.io.File file,
int sampleSize,
android.graphics.Rect region)
public static android.graphics.Bitmap decodeResourceSlice(android.content.res.Resources res,
@DrawableRes @RawRes
int resId,
int sampleSize,
android.graphics.Rect region)
@NonNull
public static float[] decodeSize(android.content.res.Resources res,
@DrawableRes @RawRes
int resId)
@NonNull public static float[] decodeSize(java.io.InputStream stream)
@NonNull public static float[] decodeSize(java.lang.String filename)
public static android.graphics.Bitmap decodeResource(android.content.res.Resources res,
@DrawableRes @RawRes
int resId)
res - resources @see #ImgLySdk.getAppResource().resId - resource id.public static void preloadResource(android.content.res.Resources res,
@DrawableRes @RawRes
int resId)
public static android.graphics.Bitmap drawResource(@NonNull
android.content.res.Resources res,
@DrawableRes
int resId,
int width,
int height)
res - Application ResourceresId - Drawable Resource id.width - destination widthheight - destination heightpublic static boolean checkIsSvgResource(@DrawableRes @RawRes
int resourceID)
resourceID - resource id.public static boolean checkIsJpegResource(@DrawableRes @RawRes
int resourceID)
resourceID - resource id.public static boolean checkIsPngResource(@DrawableRes @RawRes
int resourceID)
resourceID - resource id.public static boolean checkResourceType(@DrawableRes @RawRes
int resourceID,
java.lang.String[] suffixs)
resourceID - resource id.