summaryrefslogtreecommitdiffstats
path: root/basicsuite/Graphical Effects/effect_OpacityMask.qml
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/Graphical Effects/effect_OpacityMask.qml')
-rw-r--r--basicsuite/Graphical Effects/effect_OpacityMask.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/basicsuite/Graphical Effects/effect_OpacityMask.qml b/basicsuite/Graphical Effects/effect_OpacityMask.qml
new file mode 100644
index 0000000..e292ba4
--- /dev/null
+++ b/basicsuite/Graphical Effects/effect_OpacityMask.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ Image {
+ id: mask
+ source: "images/butterfly.png"
+ visible: false
+ }
+
+ OpacityMask {
+ id: effect;
+
+ source: image
+ maskSource: mask
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+ }
+}