How to load an ImageView from a png file?

前端 未结 6 1155
独厮守ぢ
独厮守ぢ 2020-12-29 10:57

I take a picture with the camera using

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
startActivityForResult( intent, 22 );
<         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 11:11

    Why not this way:

    ImageView MyImageView = (ImageView)findViewById(R.id.imageView1);
    Drawable d = Drawable.createFromPath( PATH TO FILE );
    MyImageView.setImageDrawable(d);
    

提交回复
热议问题