从文件系统毕加索加载图像毕加索、文件系统、图像、加载

2023-09-12 23:55:54 作者:夏槿花语

我可以使用毕加索库从文件系统加载图像?

Can I use Picasso library to load images from the filesystem?

我用startActivityForResult让用户挑选他的画廊中的照片,然后要显示所选图像。

I'm using startActivityForResult to let the user pick a photo from his gallery, and then want to show the selected image.

我已经有工作code获取图像文件系统开放的,但无法得到工作Picasso.load()方法

I already has the working code to get the image filesystem Uri, but can't get to work Picasso.load() method

推荐答案

当然可以。它实际上pretty的直截了当:

Of course you can. Its actually pretty straight forward:

File f = new File("path-to-file/file.png")

File f = new File(uri)

Picasso.with(getActivity()).load(f).into(imageView);

Picasso.with(getActivity()).load(uri).into(imageView);

工作