public final class BitmapHelper
extends java.lang.Object
Bitmap images efficiently.| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
decodeSampledBitmapFromByteArray(byte[] data,
int offset,
int length,
int desWidth,
int desHeight)
Efficiently decodes an image from a byte array.
|
static android.graphics.Bitmap |
decodeSampledBitmapFromFile(java.io.File file,
int desWidth,
int desHeight)
Efficiently decodes an image from a
File. |
static android.graphics.Bitmap |
decodeSampledBitmapFromResource(android.content.res.Resources res,
int resId,
int desWidth,
int desHeight)
Efficiently loads an image from a resource.
|
public static android.graphics.Bitmap decodeSampledBitmapFromResource(android.content.res.Resources res,
int resId,
int desWidth,
int desHeight)
Bitmap are guaranteed to be at least as large as the desired values.res - a Resource object which grants access to the resource at resIdresId - the resource ID of the image to decodedesWidth - the desired width of the returned BitmapdesHeight - the desired height of the returned BitmapBitmappublic static android.graphics.Bitmap decodeSampledBitmapFromByteArray(byte[] data,
int offset,
int length,
int desWidth,
int desHeight)
Bitmap are guaranteed to be at least as large as the desired values.data - a byte array of compressed image dataoffset - the offset into data to begin parsing atlength - the number of bytes at parse, beginning at offsetdesWidth - the desired width of the returned BitmapdesHeight - the desired height of the returned BitmapBitmappublic static android.graphics.Bitmap decodeSampledBitmapFromFile(java.io.File file,
int desWidth,
int desHeight)
File. The height and width of the returned
Bitmap are guaranteed to be at least as large as the desired values.file - the File to decodedesWidth - the desired width of the returned BitmapdesHeight - the desired height of the returned BitmapBitmap