Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

GaussianBlur in a specific Area



  • Hi everyone,

    I have a smaller Rectangle in an Image and I want this area to be blurred.
    Unfortunately, I take the complete Image as the source and not just the part where the Rectangle is.

    How can I achieve, that only the area where the rectangle is is blurred?

    import QtQuick.Controls 2.3
    import QtQuick 2.10
    import QtGraphicalEffects 1.0
    
    ApplicationWindow {
      width: 700; height: 500
      visible: true
    
      Image {
        id: image
    
        anchors.fill: parent
        source: "Sierra.jpg"
      }
    
      Rectangle {
        id: rect
        width: 200; height: 200
        anchors.centerIn: parent
      }
    
      GaussianBlur {
           anchors.fill: rect
           source: image
           radius: 8
           samples: 16
       }
    }
    



Log in to reply