Using raster images with scale factor #8656
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have managed to solve this. All you have to do is to provide image with dimensions adjusted for scale factor, and enable image scaling by setting Consider this example:
* Here, Then, as far as I understand, slint would scale this image down to fit |
Beta Was this translation helpful? Give feedback.
I have managed to solve this.
All you have to do is to provide image with dimensions adjusted for scale factor, and enable image scaling by setting
image-fit
tofill
,contain
orcover
.Consider this example:
*
ScaleFactor
is global exported by my program, where value is set by rust code to representSLINT_SCALE_FACTOR
Here,
render_board
callback returns an image with dimensions that are greater than element width and height byScaleFactor.v…