public class ImageUtils extends Object
bitmapToByte(Bitmap)bitmapToDrawable(Bitmap)byteToBitmap(byte[])byteToDrawable(byte[])drawableToBitmap(Drawable)drawableToByte(Drawable)| 构造器和说明 |
|---|
ImageUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
bitmapToByte(android.graphics.Bitmap b)
convert Bitmap to byte array
|
static android.graphics.drawable.Drawable |
bitmapToDrawable(android.graphics.Bitmap b)
convert Bitmap to Drawable
|
static android.graphics.Bitmap |
byteToBitmap(byte[] b)
convert byte array to Bitmap
|
static android.graphics.drawable.Drawable |
byteToDrawable(byte[] b)
convert byte array to Drawable
|
static android.graphics.Bitmap |
drawableToBitmap(android.graphics.drawable.Drawable d)
convert Drawable to Bitmap
|
static byte[] |
drawableToByte(android.graphics.drawable.Drawable d)
convert Drawable to byte array
|
static android.graphics.Bitmap |
getBitmapFromUrl(String imageUrl,
int readTimeOut)
get Bitmap by imageUrl
|
static android.graphics.Bitmap |
getBitmapFromUrl(String imageUrl,
int readTimeOut,
Map<String,String> requestProperties)
get Bitmap by imageUrl
|
static android.graphics.drawable.Drawable |
getDrawableFromUrl(String imageUrl,
int readTimeOutMillis)
get drawable by imageUrl
|
static android.graphics.drawable.Drawable |
getDrawableFromUrl(String imageUrl,
int readTimeOutMillis,
Map<String,String> requestProperties)
get drawable by imageUrl
|
static InputStream |
getInputStreamFromUrl(String imageUrl,
int readTimeOutMillis)
get input stream from network by imageurl, you need to close inputStream yourself
|
static InputStream |
getInputStreamFromUrl(String imageUrl,
int readTimeOutMillis,
Map<String,String> requestProperties)
get input stream from network by imageurl, you need to close inputStream yourself
|
static android.graphics.Bitmap |
scaleImage(android.graphics.Bitmap org,
float scaleWidth,
float scaleHeight)
scale image
|
static android.graphics.Bitmap |
scaleImageTo(android.graphics.Bitmap org,
int newWidth,
int newHeight)
scale image
|
public static byte[] bitmapToByte(android.graphics.Bitmap b)
b - public static android.graphics.Bitmap byteToBitmap(byte[] b)
b - public static android.graphics.Bitmap drawableToBitmap(android.graphics.drawable.Drawable d)
d - public static android.graphics.drawable.Drawable bitmapToDrawable(android.graphics.Bitmap b)
b - public static byte[] drawableToByte(android.graphics.drawable.Drawable d)
d - public static android.graphics.drawable.Drawable byteToDrawable(byte[] b)
b - public static InputStream getInputStreamFromUrl(String imageUrl, int readTimeOutMillis)
imageUrl - readTimeOutMillis - ImageUtils#getInputStreamFromUrl(String, int, boolean)public static InputStream getInputStreamFromUrl(String imageUrl, int readTimeOutMillis, Map<String,String> requestProperties)
imageUrl - readTimeOutMillis - read time out, if less than 0, not set, in millsrequestProperties - http request propertiesMalformedURLExceptionIOExceptionpublic static android.graphics.drawable.Drawable getDrawableFromUrl(String imageUrl, int readTimeOutMillis)
imageUrl - readTimeOutMillis - ImageUtils#getDrawableFromUrl(String, int, boolean)public static android.graphics.drawable.Drawable getDrawableFromUrl(String imageUrl, int readTimeOutMillis, Map<String,String> requestProperties)
imageUrl - readTimeOutMillis - read time out, if less than 0, not set, in millsrequestProperties - http request propertiespublic static android.graphics.Bitmap getBitmapFromUrl(String imageUrl, int readTimeOut)
imageUrl - readTimeOut - ImageUtils#getBitmapFromUrl(String, int, boolean)public static android.graphics.Bitmap getBitmapFromUrl(String imageUrl, int readTimeOut, Map<String,String> requestProperties)
imageUrl - requestProperties - http request propertiespublic static android.graphics.Bitmap scaleImageTo(android.graphics.Bitmap org,
int newWidth,
int newHeight)
org - newWidth - newHeight - public static android.graphics.Bitmap scaleImage(android.graphics.Bitmap org,
float scaleWidth,
float scaleHeight)
org - scaleWidth - sacle of widthscaleHeight - scale of heightCopyright © 2012-2014. All Rights Reserved.