How to resize a *.png* image in a QML code
-
wrote on 4 Mar 2019, 19:01 last edited by
Hi all,
For an image in a QML project, I need to have some manipulation which is resizing that image so that it meets the needs for its appearance.
I use these:Image { id: background source: "qrc:/images/background.png" paintedWidth: 200 paintedHeight: 200 // fillMode: Image.PreserveAspectFit }
But it doesn't have any effect on the actual image when the program is run.
-
Hi all,
For an image in a QML project, I need to have some manipulation which is resizing that image so that it meets the needs for its appearance.
I use these:Image { id: background source: "qrc:/images/background.png" paintedWidth: 200 paintedHeight: 200 // fillMode: Image.PreserveAspectFit }
But it doesn't have any effect on the actual image when the program is run.
wrote on 4 Mar 2019, 19:42 last edited byhi
@tomy said in How to resize a *.png* image in a QML code:paintedWidth: 200 paintedHeight: 200
set
width: 200 height: 200
-
hi
@tomy said in How to resize a *.png* image in a QML code:paintedWidth: 200 paintedHeight: 200
set
width: 200 height: 200
wrote on 4 Mar 2019, 21:34 last edited by@LeLev
Thanks so much.
It solved the problem.
At the commencement, I didn't test this because I thought it's very easy and couldn't work! So I went after the advanced stuff written above but it was them which didn't work in effect and this easy version is very handy! :)
1/3