Open aniceking99 opened 1 year ago
At the moment this is not supported by Slint out of the box. It is however something that we'd like to support in the future. To my surprise there's no tracking issue for this yet - so this one will be it :)
The way to do it now is using a crate like reqwest
to download the data, and then either load the temporary file, or use the image crate to generate an image that can be loaded into slint
Hello, are there any updates on this? I’d be happy to explore implementing this feature into Slint, as I believe it could provide significant benefits for many projects, particularly those with dynamic content requirements. Let me know if this is something you'd like me to work on or if there are any specific guidelines I should follow.
What I could imagine is an opt-in feature in Slint to permit image URL, including API to construct a slint::Image
from a url at run-time. The main caveats that I can see:
Those aren't blockers, just something to keep in the back of the mind.
Implementation wise I think a single image loading thread should suffice. I wouldn't go beyond that. So if it's possible to combine reqwest, as Olivier suggested, with smol (that uses a single thread), then I think that would be good compromise.
I wonder if I'm missing something. cc @ogoffart for additional input :)
The
load_from_path
method in the Image API can load local images. How can we load network images?