public final class BitmapUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
clipCircle(android.graphics.Bitmap bitmap)
Clips the corners of a bitmap in order to transform it into a round shape.
|
static android.graphics.Bitmap |
clipCircle(android.graphics.Bitmap bitmap,
int size)
Clips the corners of a bitmap in order to transform it into a round shape.
|
static android.graphics.Bitmap |
clipCircle(android.graphics.Bitmap bitmap,
int borderWidth,
int borderColor)
Clips the corners of a bitmap in order to transform it into a round shape.
|
static android.graphics.Bitmap |
clipCircle(android.graphics.Bitmap bitmap,
int size,
int borderWidth,
int borderColor)
Clips the corners of a bitmap in order to transform it into a round shape.
|
static android.graphics.Bitmap |
clipSquare(android.graphics.Bitmap bitmap)
Clips the long edge of a bitmap, if its width and height are not equal, in order to form it
into a square.
|
static android.graphics.Bitmap |
clipSquare(android.graphics.Bitmap bitmap,
int size)
Clips the long edge of a bitmap, if its width and height are not equal, in order to form it
into a square.
|
static android.graphics.Bitmap |
clipSquare(android.graphics.Bitmap bitmap,
int borderWidth,
int borderColor)
Clips the long edge of a bitmap, if its width and height are not equal, in order to transform
it into a square.
|
static android.graphics.Bitmap |
clipSquare(android.graphics.Bitmap bitmap,
int size,
int borderWidth,
int borderColor)
Clips the long edge of a bitmap, if its width and height are not equal, in order to transform
it into a square.
|
static android.graphics.Bitmap |
drawableToBitmap(android.graphics.drawable.Drawable drawable)
Creates and returns a bitmap from a specific drawable.
|
static android.graphics.Bitmap |
resize(android.graphics.Bitmap bitmap,
int width,
int height)
Resizes a bitmap to a specific width and height.
|
static android.graphics.Bitmap |
tile(android.graphics.Bitmap bitmap,
int width,
int height)
Creates and returns a bitmap with a specific width and height by tiling another bitmap.
|
static android.graphics.Bitmap |
tint(android.graphics.Bitmap bitmap,
int color)
Creates and returns a bitmap by overlaying it with a specific color.
|
public static android.graphics.Bitmap clipCircle(android.graphics.Bitmap bitmap)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullBitmappublic static android.graphics.Bitmap clipCircle(android.graphics.Bitmap bitmap,
int size)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullsize - The size, the bitmap should be resized to, as an Integer value in pixels. The
size must be at least 1Bitmappublic static android.graphics.Bitmap clipCircle(android.graphics.Bitmap bitmap,
int borderWidth,
int borderColor)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullborderWidth - The width of the border as an Integer value in pixels. The width must be at
least 0borderColor - The color of the border as an Integer valueBitmappublic static android.graphics.Bitmap clipCircle(android.graphics.Bitmap bitmap,
int size,
int borderWidth,
int borderColor)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullsize - The size, the bitmap should be resized to, as an Integer value in pixels. The
size must be at least 1borderWidth - The width of the border as an Integer value in pixels. The width must be at
least 0borderColor - The color of the border as an Integer valueBitmappublic static android.graphics.Bitmap clipSquare(android.graphics.Bitmap bitmap)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullBitmappublic static android.graphics.Bitmap clipSquare(android.graphics.Bitmap bitmap,
int size)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullsize - The size, the bitmap should be resized to, as an Integer value in pixels. The
size must be at least 1Bitmappublic static android.graphics.Bitmap clipSquare(android.graphics.Bitmap bitmap,
int borderWidth,
int borderColor)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullborderWidth - The width of the border as an Integer value in pixels. The width must be at
least 0borderColor - The color of the border as an Integer valueBitmappublic static android.graphics.Bitmap clipSquare(android.graphics.Bitmap bitmap,
int size,
int borderWidth,
int borderColor)
bitmap - The bitmap, which should be clipped, as an instance of the class Bitmap. The
bitmap may not be nullsize - The size, the bitmap should be resized to, as an Integer value in pixels. The
size must be at least 1borderWidth - The width of the border as an Integer value in pixels. The width must be at
least 0borderColor - The color of the border as an Integer valueBitmappublic static android.graphics.Bitmap resize(android.graphics.Bitmap bitmap,
int width,
int height)
bitmap - The bitmap, which should be resized, as an instance of the class Bitmap. The
bitmap may not be nullwidth - The width, the bitmap should be resized to, as an Integer value in pixels.
The width must be at least 1height - The height, the bitmap should be resized to, as an Integer value in pixels.
The height must be at least 1Bitmappublic static android.graphics.Bitmap tile(android.graphics.Bitmap bitmap,
int width,
int height)
bitmap - The bitmap, which should be tiled, as an instance of the class Bitmap. The
bitmap may not be nullwidth - The width of the bitmap as an Integer value in pixels. The width must be at
least 1height - The height of the bitmap as an Integer value in pixels. The height must be at
least 1Bitmappublic static android.graphics.Bitmap tint(android.graphics.Bitmap bitmap,
int color)
bitmap - The bitmap, which should be tinted, as an instance of the class Bitmap. The
bitmap may not be nullcolor - The color, which should be used for tinting, as an Integer valueBitmappublic static android.graphics.Bitmap drawableToBitmap(android.graphics.drawable.Drawable drawable)
drawable - The drawable, which should be converted, as an instance of the class Drawable. The drawable may not be nullBitmap