Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. private Bitmap getImageMaskBitmap(Uri imagePath) {
  2. try {
  3. Bitmap maskBitmap = null;
  4.  
  5. if (maskBitmap == null) {
  6. if (imagePath.getPath() != null) {
  7. Log.d("dbg", "Def uri: " + imagePath.getPath());
  8. String imageDirectory = imagePath.getPath()
  9. .replace("/".concat(imageFilename), "");
  10. String maskPath = imageDirectory.concat("/".concat(DATASET_DIRECTORY_NAME)
  11. .concat("/")
  12. .concat(imageFilename));
  13. File f = new File(getPath(imagePath));
  14. Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),
  15. Uri.parse(maskPath));
  16. }
  17. }
  18.  
  19. return maskBitmap;
  20. } catch (Exception e) {
  21. Log.d("dbg", e.getMessage());
  22. return null;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement