public class ImageUtils
extends java.lang.Object
构造器和说明 |
---|
ImageUtils() |
限定符和类型 | 方法和说明 |
---|---|
static android.graphics.Bitmap |
convertViewToBitmap(android.view.View view)
Convert a View to Bitmap using view.getDrawingCache()
|
static android.graphics.Bitmap |
convertViewToBitmapWithCanvas(android.view.View view,
int bitmapWidth,
int bitmapHeight)
Convert a View to Bitmap using view.draw(new Canvas(bitmap))
|
static android.graphics.Bitmap |
createBitmapForWatermark(android.graphics.Bitmap srcBitmap,
android.graphics.Bitmap watermark)
Create watermark picture
|
static android.graphics.Bitmap |
potoMix(int direction,
android.graphics.Bitmap... bitmaps)
Picture compose.
|
static android.graphics.Bitmap |
revertImageSize(java.lang.String path)
Revert image file to a square with width and height equal 1000
|
static android.graphics.Bitmap |
revertImageSize(java.lang.String path,
int width)
Revert image file to a square with custom size
|
static android.graphics.Bitmap |
revertImageSize(java.lang.String path,
int width,
int height)
Revert image file to custom size
|
static void |
saveBitmapToPNG(android.graphics.Bitmap bitmap,
java.lang.String name)
Save bitmap to a .png file
|
static void |
saveJPGE_After(android.graphics.Bitmap bitmap,
java.lang.String path)
Save bitmap to a .jpeg file
|
static android.graphics.Bitmap |
toGrayscale(android.graphics.Bitmap bmpOriginal)
Gray Image
|
static android.graphics.Bitmap |
toRoundCorner(android.graphics.Bitmap bitmap,
int pixels)
toRoundCorner
|
static android.graphics.Bitmap |
zoomBitmap(android.graphics.Bitmap bitmap,
float width,
float height)
Zoom bitmap using Matrix
|
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static android.graphics.Bitmap toGrayscale(android.graphics.Bitmap bmpOriginal)
bmpOriginal
- public static android.graphics.Bitmap toRoundCorner(android.graphics.Bitmap bitmap, int pixels)
bitmap
- pixels
- public static android.graphics.Bitmap createBitmapForWatermark(android.graphics.Bitmap srcBitmap, android.graphics.Bitmap watermark)
srcBitmap
- watermark
- public static android.graphics.Bitmap potoMix(int direction, android.graphics.Bitmap... bitmaps)
direction
- bitmaps
- public static android.graphics.Bitmap zoomBitmap(android.graphics.Bitmap bitmap, float width, float height)
bitmap
- width
- height
- public static void saveBitmapToPNG(android.graphics.Bitmap bitmap, java.lang.String name) throws java.io.FileNotFoundException, java.io.IOException
bitmap
- name
- java.io.FileNotFoundException
java.io.IOException
public static void saveJPGE_After(android.graphics.Bitmap bitmap, java.lang.String path) throws java.io.FileNotFoundException, java.io.IOException
bitmap
- path
- java.io.FileNotFoundException
java.io.IOException
public static android.graphics.Bitmap revertImageSize(java.lang.String path, int width) throws java.io.IOException
path
- width
- java.io.IOException
public static android.graphics.Bitmap revertImageSize(java.lang.String path) throws java.io.IOException
path
- java.io.IOException
public static android.graphics.Bitmap revertImageSize(java.lang.String path, int width, int height) throws java.io.IOException
path
- width
- height
- java.io.IOException
public static android.graphics.Bitmap convertViewToBitmap(android.view.View view)
view
- public static android.graphics.Bitmap convertViewToBitmapWithCanvas(android.view.View view, int bitmapWidth, int bitmapHeight)
view
- bitmapWidth
- bitmapHeight
-