Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show images from URL #812

Open
duttabhishek0 opened this issue Oct 20, 2021 · 2 comments
Open

Show images from URL #812

duttabhishek0 opened this issue Oct 20, 2021 · 2 comments

Comments

@duttabhishek0
Copy link

🚀 Feature Requests

Fetch Image from an URL present in the form of String

Contextualize the feature

Images are stored as URLs in Cloud Databases. Need of a method to fetch image from that URL and then display.

Describe the feature

Currently to set an Image, the following method is invoked:

imageView.setImageResource(R.drawable.image_id)

The method only accepts a parameter of type resource id. But if a string is provided instead, it would give compilation errors. Please add a feature to fetch image from cloud database, given in form of URL. A URL is of type String.

@tarekmabdallah91
Copy link

you can use Picasso or Glide to achieve this.

@francoisnicolas
Copy link

add in your main program :
... get File by TCPIP download from your database
Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); // file : File to your image
mPhotoView.setImageBitmap(myBitmap);

add in PhotoView.java :
@OverRide
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
if (attacher != null) {
attacher.update();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants