[Solved] preserve original aspect ratio on Image
-
Have you seen the imageelements declarative example that ships with Qt ? Is that what you are looking for ?
-
you mean : "Image element":http://doc.qt.nokia.com/4.7/qml-image.html ?
Yes I was looking at that, and I'm interested in the fillMode property however:
"Set this property to define what happens when the image set for the item is smaller than the size of the item."And I'm interested in the situation when the picture is larger than the size of item
-
[quote author="2beers" date="1289119699"]And I'm interested in the situation when the picture is larger than the size of item[/quote]
I just tried setting a larger image (640x340) in a 200x200 image element and the PreserveAspectFit worked just fine.
-
[quote author="chetankjain" date="1289192635"]
I just tried setting a larger image (640x340) in a 200x200 image element and the PreserveAspectFit worked just fine.
[/quote]can you post your example please, in mine it doesn't. I'm using qt 4.7.0 . Are you using a different version?
-
yup I'm on 4.7.0. In the same Image Element example, you can try to replace the small smiley they are using with a much larger image... that test case would do ? (see ImageCell.qml)
then you can resize the window and chk how the various image modes work.
-
2 beers and cheers to u 2beers :p
glad it worked :)