开发者

Android - Display image that is of type file

I have an image that is 开发者_如何学运维currently stored in variable of type "File"..

File img = ...;

What is the easiest way to display this image onto the screen so I can verify it is working correct?

Thanks!


If you have an ImageView in your layout, you can do something like this, assuming you have a reference to your ImageView named view:

Drawable d = Drawable.createFromPath(img);
image.setImageDrawable(d);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜