public final class ImageTools extends Object
| 构造器和说明 |
|---|
ImageTools() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
Bitmap2Bytes(android.graphics.Bitmap bm) |
static byte[] |
bitmapToBytes(android.graphics.Bitmap bm)
Bitmap transfer to bytes
|
static android.graphics.drawable.Drawable |
bitmapToDrawable(android.graphics.Bitmap bitmap)
Bitmap to drawable
|
static android.graphics.Bitmap |
byteToBitmap(byte[] byteArray)
Byte transfer to bitmap
|
static android.graphics.drawable.Drawable |
byteToDrawable(byte[] byteArray)
Byte transfer to drawable
|
static int |
calculateInSampleSize(android.graphics.BitmapFactory.Options options,
int reqWidth,
int reqHeight) |
static boolean |
checkSDCardAvailable()
Check the SD card
|
static android.graphics.Bitmap |
createReflectionImageWithOrigin(android.graphics.Bitmap bitmap)
Create reflection images
|
static android.graphics.Bitmap |
decodeSampledBitmapFromFile(android.graphics.Bitmap bmp,
int reqWidth,
int reqHeight) |
static void |
deleteAllPhoto(String path)
Delete the image from SD card
|
static void |
deletePhotoAtPathAndName(String path,
String fileName) |
static void |
deletePhotoByName(String reallyPath) |
static android.graphics.Bitmap |
drawableToBitmap(android.graphics.drawable.Drawable drawable)
Transfer drawable to bitmap
|
static byte[] |
drawableToBytes(android.graphics.drawable.Drawable drawable)
Drawable transfer to bytes
|
static boolean |
findPhotoFromSDCard(String path,
String photoName)
Get image from SD card by path and the name of image
|
static android.graphics.Bitmap |
getPhotoFromSDCard(String path,
String photoName)
Get images from SD card by path and the name of image
|
static android.graphics.Bitmap |
getRoundedCornerBitmap(android.graphics.Bitmap bitmap,
float roundPx)
Get rounded corner images
|
static android.graphics.Bitmap |
inputStreamToBitmap(InputStream inputStream)
Input stream to bitmap
|
static void |
savePhotoToSDCard(android.graphics.Bitmap photoBitmap,
String path,
String photoName)
Save image to the SD card
|
static android.graphics.Bitmap |
zoomBitmap(android.graphics.Bitmap bitmap,
int width,
int height)
Resize the bitmap
|
static android.graphics.drawable.Drawable |
zoomDrawable(android.graphics.drawable.Drawable drawable,
int w,
int h)
Resize the drawable
|
public static android.graphics.Bitmap drawableToBitmap(android.graphics.drawable.Drawable drawable)
drawable - public static android.graphics.drawable.Drawable bitmapToDrawable(android.graphics.Bitmap bitmap)
bitmap - public static android.graphics.Bitmap inputStreamToBitmap(InputStream inputStream) throws Exception
inputStream - Exceptionpublic static android.graphics.Bitmap byteToBitmap(byte[] byteArray)
byteArray - public static android.graphics.drawable.Drawable byteToDrawable(byte[] byteArray)
byteArray - public static byte[] bitmapToBytes(android.graphics.Bitmap bm)
bm - public static byte[] drawableToBytes(android.graphics.drawable.Drawable drawable)
drawable - public static android.graphics.Bitmap createReflectionImageWithOrigin(android.graphics.Bitmap bitmap)
bitmap - public static android.graphics.Bitmap getRoundedCornerBitmap(android.graphics.Bitmap bitmap,
float roundPx)
bitmap - roundPx - 5 10public static android.graphics.Bitmap zoomBitmap(android.graphics.Bitmap bitmap,
int width,
int height)
bitmap - width - height - public static android.graphics.drawable.Drawable zoomDrawable(android.graphics.drawable.Drawable drawable,
int w,
int h)
drawable - w - h - public static android.graphics.Bitmap getPhotoFromSDCard(String path, String photoName)
photoName - public static boolean checkSDCardAvailable()
public static boolean findPhotoFromSDCard(String path, String photoName)
path - public static void savePhotoToSDCard(android.graphics.Bitmap photoBitmap,
String path,
String photoName)
photoBitmap - photoName - path - public static void deleteAllPhoto(String path)
path - file:///sdcard/temp.jpgpublic static void deletePhotoByName(String reallyPath)
public static android.graphics.Bitmap decodeSampledBitmapFromFile(android.graphics.Bitmap bmp,
int reqWidth,
int reqHeight)
public static byte[] Bitmap2Bytes(android.graphics.Bitmap bm)
public static int calculateInSampleSize(android.graphics.BitmapFactory.Options options,
int reqWidth,
int reqHeight)