2017-03-02 12 views
-2

全画面を中央の横にbluredする必要があります。 どうすれば作れますか?QMLのぼかしの効果

FastBlur 
{ 
    x: 0 
    y: 0 
    height: Screen.desktopAvailableHeight 
    width: Screen.desktopAvailableWidth 
    source: video 
    radius: 100 
} 

//私はぼかし

Rectangle 
{ 
    x: 100 
    y: 100 
    height: 250 
    width: 250 
    color: "red" 
} 

答えて

0
import QtQuick 2.5 
import QtQuick.Window 2.2 
import QtGraphicalEffects 1.0 

Window 
{ 
    visible: true 
    width: 640 
    height: 480 
    title: qsTr("Hello World") 

    Image 
    { 
     id:img 
     source:"qrc:/Tulips.jpg" 
     anchors.fill: parent 
     visible: false 
    } 

    FastBlur 
    { 
     anchors.fill: parent 
     source: img 
     radius: 100 
    } 

    Rectangle 
    { 
     id:rect 
     height: 250 
     width: 250 
     anchors.centerIn: parent 
     color:"red" 
    } 
} 
+0

いいえ、私のfastblurソースはvideooutputで、センターはクリアでなければなりません –

0

zの値を使用せずに、この広場をしたいですか?

Window { 
    Rectangle { 
     z: 0 
     id: blurred_background 
     anchors.fill: parent 
    } 
    FastBlue { 
     z: 1 
     anchors.fill: parent 
     source: blurred_background 
    } 
    Rectangle { 
     z: 2 
     id: nonblurred_foreground 
     height: 250 
     width: 250 
    } 
} 

矩形を任意の項目に置き換えてください。 そして、文書で警告を無視しないようにしてください。blur cannot blur a parent of itself as source

関連する問題