public class BitmapFactoryUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkIsSvgResource(int resourceID)
Check if the raw resource is a svg 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 float[] |
decodeSize(android.content.res.Resources res,
int resId) |
static float[] |
decodeSize(java.lang.String filename) |
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.
|
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.@NonNull
public static float[] decodeSize(android.content.res.Resources res,
@DrawableRes @RawRes
int resId)
@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 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.