Create a Bitmap/Drawable from file path

后端 未结 6 1093
故里飘歌
故里飘歌 2020-11-28 06:56

I\'m trying to create a Bitmap or Drawable from existing file path.

String path = intent.getStringExtra(\"FilePath\");
BitmapFactory.Options option = new Bit         


        
6条回答
  •  甜味超标
    2020-11-28 07:57

    Well, using the static Drawable.createFromPath(String pathName) seems a bit more straightforward to me than decoding it yourself... :-)

    If your mImg is a simple ImageView, you don't even need it, use mImg.setImageUri(Uri uri) directly.

提交回复
热议问题