summaryrefslogtreecommitdiffstats
path: root/examples/declarative/effects/test.qml
blob: 83bfde2ebdeecd726586db75b002b8d190d1f9c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import Qt 4.6

Rectangle {
    color: "white"
    width: 800
    height: 600

    Image {
        source: "pic.jpg"

        effect: Blur {
            blurRadius: NumberAnimation { id: blur; from: 0; to: 10; duration: 200; repeat: true }
        }

        MouseRegion { anchors.fill: parent; onClicked: blur.running = !blur.running }

        Text { color: "white"; text: "Blur" }
    }

    Image {
        source: "pic.jpg"

        x: 200
        effect: Grayscale {}

        Text { color: "white"; text: "Grayscale" }
    }

    Image {
        source: "pic.jpg"

        x: 400
        effect: Colorize { color: "blue" }

        Text { color: "white"; text: "Colorize" }
    }

    Image {
        source: "pic.jpg"

        y: 300
        effect: Pixelize {
            pixelSize: NumberAnimation { id: pixelize; from: 0; to: 10; duration: 200; repeat: true }
        }

        MouseRegion { anchors.fill: parent; onClicked: pixelize.running = !pixelize.running }

        Text { color: "white"; text: "Pixelize" }
    }


    Image {
        source: "pic.jpg"

        x: 200
        y: 300
        effect: DropShadow {
            blurRadius: 3
            offset.x: 3
            offset.y: NumberAnimation { id: dropShadow; from: 0; to: 10; duration: 200; repeat: true; }
        }

        MouseRegion { anchors.fill: parent; onClicked: dropShadow.running = !dropShadow.running }

        Text { color: "white"; text: "DropShadow" }
    }


    Image {
        source: "pic.jpg"

        x: 400
        y: 300
        effect: Bloom {
            blurRadius: 3
            brightness: 128
            strength: NumberAnimation { id: bloom; from: 0; to: 1; duration: 200; repeat: true; }
        }

        MouseRegion { anchors.fill: parent; onClicked: bloom.running = !bloom.running }

        Text { color: "white"; text: "Bloom" }
    }

    Text {
        x: 100; y: 250
        text: "Clicking Blur, Pixelize or DropShadow will \ntoggle animation."
        color: "black"
    }

}