Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
How to crop an image inside an item (rectangle)?
I would like to load and display a picture (.png) inside a circle (rectangle) that I have defined. I have done some tries with Image.PreserveAspectCrop but they were not conclusive. I want my image to perfectly fit the border of the circle. Is that possible with Qt Quick?
Thanks a lot!
hmuelner last edited by
You could use a Canvas and the clip API (see "the Canvas example":http://qt-project.org/doc/qt-5/qtquick-canvas-example.html
I will investigate this path and hopefully this would help me!
Or you could use "OpacityMask":http://qt-project.org/doc/qt-5/qml-qtgraphicaleffects-opacitymask.html.
Woooow! Perfect! That's exactly what I need! Thank you so much