Package com.massifmaps.utils
Class BitmapUtils
java.lang.Object
com.massifmaps.utils.BitmapUtils
A helper class for loading bitmaps and converting Bitmaps to Android Bitmaps an vice versa.
-
Method Summary
Modifier and TypeMethodDescriptionstatic android.graphics.BitmapcreateAndroidBitmapFromBitmap(Bitmap bitmap) Creates a new Android Bitmap from an existing Bitmap.static BitmapcreateBitmapFromAndroidBitmap(android.graphics.Bitmap androidBitmap) Creates a new Bitmap object from an existing Android Bitmap.static BitmaploadBitmapFromAssets(String assetPath) Loads the specified bitmap asset bundled with the application.static BitmaploadBitmapFromFile(String filePath) Loads bitmap from specified file.
-
Method Details
-
loadBitmapFromAssets
Loads the specified bitmap asset bundled with the application.- Parameters:
assetPath- The asset path to the image to be loaded.- Returns:
- The loaded bitmap.
-
loadBitmapFromFile
Loads bitmap from specified file.- Parameters:
filePath- The path to the image to be loaded.- Returns:
- The loaded bitmap.
-
createBitmapFromAndroidBitmap
Creates a new Bitmap object from an existing Android Bitmap.- Parameters:
androidBitmap- The reference Android bitmap.- Returns:
- The created bitmap.
-
createAndroidBitmapFromBitmap
Creates a new Android Bitmap from an existing Bitmap.- Parameters:
bitmap- The existing bitmap.- Returns:
- The android Bitmap.
-