Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. GaussianBlur in a specific Area

GaussianBlur in a specific Area

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 416 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Leon_2001
    wrote on last edited by
    #1

    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
       }
    }
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      shaan7
      wrote on last edited by
      #2

      You should be able to use MaskedBlur http://doc.qt.io/qt-5/qml-qtgraphicaleffects-maskedblur.html

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved