Package com.castlabs.android.utils
Class ImageUtils
java.lang.Object
com.castlabs.android.utils.ImageUtils
Image utilities that offers helper functions to decode and scale bitmap images.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Bitmap
decodeBitmap
(byte[] data) Creates aBitmap
from teh given data arraystatic Bitmap
downsizeBitmap
(byte[] data, int targetWidth) Scale the given bitmap data and return a new, scaledBitmap
if target width is specified.
-
Method Details
-
decodeBitmap
Creates aBitmap
from teh given data array- Parameters:
data
- the data array- Returns:
- the bitmap
-
downsizeBitmap
Scale the given bitmap data and return a new, scaledBitmap
if target width is specified. If no target with is given, the unscaled bitmap is loaded and returned.- Parameters:
data
- the data arraytargetWidth
- the target width or -1- Returns:
- the scaled image
-