[Interest] QML Image sourceSize bug (?)

Alexander Dyagilev alervdvcw at gmail.com
Sat Mar 27 04:20:07 CET 2021


I have PNG image of 256x256 size.

I'm trying to show it on 25x25 size using this code:

Image{

width:25

height:25

fillMode:Image.PreserveAspectFit

horizontalAlignment:Image.AlignHCenter

verticalAlignment:Image.AlignVCenter

source:preview.url

}

I'm getting this:

If I add sourceSize so the code becomes this:

Image{

width:25

height:25

sourceSize.height:25

sourceSize.width:25

fillMode:Image.PreserveAspectFit

horizontalAlignment:Image.AlignHCenter

verticalAlignment:Image.AlignVCenter

source:preview.url

}

I'm getting this:

Looks better. Why is it so?

OS: Windows 10. Screen.devicePixelRatio is 1.0.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210327/7df2e67e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ofncckjhhakklabd.png
Type: image/png
Size: 954 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210327/7df2e67e/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kahleifdjdelkcng.png
Type: image/png
Size: 1276 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210327/7df2e67e/attachment-0001.png>


More information about the Interest mailing list