| java.lang.Object | |
| ↳ | com.davidluoye.support.util.BitmapUtil |
Provides static functions to decode bitmaps at the optimal size
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static Bitmap |
decodeBitmapFromBytes(byte[] bytes, int sampleSize)
Decodes the bitmap with the given sample size
| ||||||||||
| static int |
findOptimalSampleSize(int originalSmallerExtent, int targetExtent)
Finds the optimal sampleSize for loading the picture
| ||||||||||
| static Drawable |
getRotatedDrawable(Resources resources, int resourceId, float angle)
Retrieves a copy of the specified drawable resource, rotated by a specified angle.
| ||||||||||
| static Bitmap |
getRoundedBitmap(Bitmap input, int targetWidth, int targetHeight)
Given an input bitmap, scales it to the given width/height and makes it round.
| ||||||||||
| static int |
getSmallerExtentFromBytes(byte[] bytes)
Returns Width or Height of the picture, depending on which size is smaller.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Decodes the bitmap with the given sample size
Finds the optimal sampleSize for loading the picture
| originalSmallerExtent | Width or height of the picture, whichever is smaller |
|---|---|
| targetExtent | Width or height of the target view, whichever is bigger. If either one of the parameters is 0 or smaller, no sampling is applied |
Retrieves a copy of the specified drawable resource, rotated by a specified angle.
| resources | The current resources. |
|---|---|
| resourceId | The resource ID of the drawable to rotate. |
| angle | The angle of rotation. |
Given an input bitmap, scales it to the given width/height and makes it round.
| input | Bitmap to scale and crop |
|---|---|
| targetWidth | desired output width |
| targetHeight | desired output height |
Returns Width or Height of the picture, depending on which size is smaller. Doesn't actually decode the picture, so it is pretty efficient to run.