Skip to content

QQuickImageProvider equivalent in slint? #2712

Closed Answered by tronical
bog-dan-ro asked this question in General
Discussion options

You must be logged in to vote

Images are specified with the source property. You can either supply that give the literal @image-url("string literal path to image here") or you can programmatically create slint::Image objects in Rust and C++ and assign them to the source property. The type of the source property is image, which maps to slint::Image.

The documentation linked above has examples how to create slint::Image objects from pixel buffers. Those are shared by reference count. Both, in Rust and C++, slint::Image can also be created from a path to an image file on disk, using load_from_path().

If you repeatedly call slint::Image::load_from_path() with the same path, it will only load the image from disk the first …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bog-dan-ro
Comment options

@bog-dan-ro
Comment options

@tronical
Comment options

@bog-dan-ro
Comment options

@tronical
Comment options

Answer selected by tronical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants