public class ImageUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ORIENTATION_LANDSCAPE |
static int |
ORIENTATION_PORTRAIT |
| Constructor and Description |
|---|
ImageUtils() |
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
decodeSampledBitmap(android.content.Context context,
android.net.Uri imageUri,
int reqWidth,
int reqHeight)
Decodes the image as a bitmap with a size as small as possible but with a minimum size of given reqWidth
and reqHeight.
|
static android.graphics.Bitmap |
decodeSampledBitmap(java.io.File file,
int reqWidth,
int reqHeight)
Decodes the image as a bitmap with a size as small as possible but with a minimum size of given reqWidth
and reqHeight.
|
static int |
determineOrientation(android.content.Context context,
android.net.Uri uri)
Determines the orientation of the image based on its ratio.
|
static int |
determineOrientation(java.io.File file)
Determines the orientation of the image based on its ratio.
|
static int |
determineOrientation(java.io.InputStream input)
Determines the orientation of the image based on its ratio.
|
public static final int ORIENTATION_PORTRAIT
public static final int ORIENTATION_LANDSCAPE
public static int determineOrientation(java.io.File file)
throws java.io.IOException
file - the file handle of the imagejava.io.IOException - if the file couldn't be processedpublic static int determineOrientation(android.content.Context context,
android.net.Uri uri)
context - the context to useuri - the URI of the imagepublic static int determineOrientation(java.io.InputStream input)
input - the input stream of the imagepublic static android.graphics.Bitmap decodeSampledBitmap(java.io.File file,
int reqWidth,
int reqHeight)
throws java.io.IOException
file - the file handle of the imagereqWidth - required widthreqHeight - required heightjava.io.IOException - if the file couldn't be processedpublic static android.graphics.Bitmap decodeSampledBitmap(android.content.Context context,
android.net.Uri imageUri,
int reqWidth,
int reqHeight)
throws java.io.IOException
context - the context to useimageUri - the URI of the imagereqWidth - required widthreqHeight - required heightjava.io.IOException - if the URI couldn't be processed