Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Bitmap getImageMaskBitmap(Uri imagePath) {
- try {
- Bitmap maskBitmap = null;
- if (maskBitmap == null) {
- if (imagePath.getPath() != null) {
- Log.d("dbg", "Def uri: " + imagePath.getPath());
- String imageDirectory = imagePath.getPath()
- .replace("/".concat(imageFilename), "");
- String maskPath = imageDirectory.concat("/".concat(DATASET_DIRECTORY_NAME)
- .concat("/")
- .concat(imageFilename));
- File f = new File(getPath(imagePath));
- Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),
- Uri.parse(maskPath));
- }
- }
- return maskBitmap;
- } catch (Exception e) {
- Log.d("dbg", e.getMessage());
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement