public class BitmapFactoryUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static android.util.SparseArray<android.os.MemoryFile> |
memoryFileHashMap |
static android.graphics.Bitmap |
NOTING_BITMAP |
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 |
checkIsXMLResource(int resourceID)
Check if the resource is a xml 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 int[] |
decodeSize(java.io.InputStream stream) |
static int[] |
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 |
drawResource(android.content.res.Resources res,
int resId)
Draw a XML Drawable resource to a Bitmap because a XML Drawable not can be decoded by #decodeResource
|
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 android.util.SparseArray<android.os.MemoryFile> memoryFileHashMap
public static final android.graphics.Bitmap NOTING_BITMAP
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 checkIsSvgResource(@DrawableRes @RawRes int resourceID)
resourceID
- resource id.public static boolean checkIsXMLResource(@DrawableRes @RawRes int resourceID)
resourceID
- resource id.public static boolean checkResourceType(@DrawableRes @RawRes int resourceID, java.lang.String... suffixs)
resourceID
- resource id.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 android.graphics.Bitmap decodeResource(android.content.res.Resources res, @DrawableRes @RawRes int resId)
res
- resources @see #PESDK.getAppResource().resId
- resource id.public static android.graphics.Bitmap decodeResource(android.content.res.Resources res, @DrawableRes @RawRes int resId, int minSize)
res
- resources @see #PESDK.getAppResource().resId
- resource id.minSize
- minWidth the image must have.@NonNull public static int[] decodeSize(java.io.InputStream stream)
@NonNull public static int[] decodeSize(android.content.res.Resources res, @DrawableRes @RawRes int resId)
@NonNull public static float[] decodeSize(java.lang.String filename)
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.IOException
public static android.graphics.Bitmap drawResource(@NonNull android.content.res.Resources res, @DrawableRes int resId)
res
- Application ResourceresId
- Drawable Resource id.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 int getImageRotation(java.lang.String filename)
filename
- image file path.public static void preloadResource(android.content.res.Resources res, @DrawableRes @RawRes int resId)