0

I try the FastBlur with doc. Why I always got a purple image? Take off the FastBlur the image is right.

import QtQuick
import Qt5Compat.GraphicalEffects
Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")


    Image {
        id: icon
        anchors.centerIn: parent
        width: 132
        height: 105
        source: "file:////Users/otis.lin/Desktop/test.png"

        FastBlur {
            anchors.fill: icon
            source: icon
            radius: 64
        }
    }
}

purple image:

purple image


Update code here, this is work for me.

    Image {
        id: img
        anchors.fill: parent
        source: "file:////Users/otis.lin/Desktop/test.png"
        sourceSize: Qt.size(parent.width, parent.height)
        smooth: true

    }
    FastBlur{
        id: blur
        anchors.fill: parent
        source: img
        radius: 32
    }
Otis Lin
  • 23
  • 1
  • 4
  • 2
    probably `FastBlur` shouldn't be a child of the `Image` but sibling – folibis Jun 02 '22 at 06:08
  • your question is like this: https://stackoverflow.com/a/68863137/9484913 , and that answer will fix it. – Parisa.H.R Jun 02 '22 at 22:00
  • thanks guys, layer.effect: ShaderEffect not working, still have a purple image, I tried some methods about the @Parisa.H.R reply stackoverflow.com/a/68863137/9484913 , code update under my question. – Otis Lin Jun 03 '22 at 02:20

0 Answers0