Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
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