public class DefaultImageReSizer extends java.lang.Object implements ImageReSizer
ImageReSizer| Constructor and Description |
|---|
DefaultImageReSizer() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateInSampleSize(int originWidth,
int originHeight,
int reqWidth,
int reqHeight)
Calculate an inSampleSize for use in a
BitmapFactory.Options object when decoding bitmaps using the decode* methods from BitmapFactory. |
int |
getInSampleSize(ImageTask imageTask)
Return the
BitmapFactory.Options#inSampleSize, which will be used when load the image from the disk. |
static DefaultImageReSizer |
getInstance() |
java.lang.String |
getRemoteUrl(ImageTask imageTask) |
public static DefaultImageReSizer getInstance()
public int getInSampleSize(ImageTask imageTask)
ImageReSizerBitmapFactory.Options#inSampleSize, which will be used when load the image from the disk.
You should better calculate this value according the hard device of the mobile.getInSampleSize in interface ImageReSizerpublic java.lang.String getRemoteUrl(ImageTask imageTask)
getRemoteUrl in interface ImageReSizerpublic static int calculateInSampleSize(int originWidth,
int originHeight,
int reqWidth,
int reqHeight)
BitmapFactory.Options object when decoding bitmaps using the decode* methods from BitmapFactory.
This implementation calculates the closest inSampleSize that is a times of 2 and will result in the final decoded bitmap having a width and height equal to or larger than the requested width and height.