public class BitmapUtils
Contains convenient methods for Bitmaps
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateInSampleSize()
Calculates best inSampleSize to fit reqWidth and reqHeight or a bit more
|
static void |
compress()
Compresses Bitmap to File
|
static android.graphics.Bitmap |
createPreview()
Create preview from large (nodpi) resource image
|
static android.graphics.Bitmap |
createPreview()
Create preview from image byte array
|
static android.graphics.Bitmap |
decodeQuietly()
Decodes Bitmap with minimal log output. Accepts
null arguments. |
static android.graphics.Bitmap |
drawableToBitmap()
Converts image drawable to bitmap
|
static android.graphics.Rect |
getBitmapBounds() |
static android.graphics.Rect |
getContentBounds() |
static boolean |
isBitmapValid() |
public static android.graphics.Rect getBitmapBounds()
public static boolean isBitmapValid()
true if Bitmap valid (and can be drawed). false otherwise.public static android.graphics.Rect getContentBounds()
public static void compress()
Compresses Bitmap to File
public static android.graphics.Bitmap createPreview()
Create preview from large (nodpi) resource image
public static android.graphics.Bitmap createPreview()
Create preview from image byte array
public static int calculateInSampleSize()
Calculates best inSampleSize to fit reqWidth and reqHeight or a bit more
public static android.graphics.Bitmap decodeQuietly()
Decodes Bitmap with minimal log output. Accepts null arguments.
null if load failed.public static android.graphics.Bitmap drawableToBitmap()
Converts image drawable to bitmap