|
@@ -13,6 +13,7 @@ Window {
|
|
|
id: d
|
|
|
|
|
|
property int screenCount: 0
|
|
|
+ property var images: []
|
|
|
}
|
|
|
|
|
|
Item{
|
|
@@ -32,6 +33,7 @@ Window {
|
|
|
|
|
|
color: "black"
|
|
|
radius: width
|
|
|
+ visible: true
|
|
|
}
|
|
|
|
|
|
SequentialAnimation{
|
|
@@ -45,6 +47,26 @@ Window {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ Image {
|
|
|
+ id: img
|
|
|
+ anchors.fill: parent
|
|
|
+ mipmap: true
|
|
|
+ asynchronous: true
|
|
|
+ visible: false
|
|
|
+ }
|
|
|
+
|
|
|
+ MouseArea{
|
|
|
+ anchors.fill: parent
|
|
|
+ onClicked: {
|
|
|
+ timeToScreenShoot.stop()
|
|
|
+ moveAnimation.stop()
|
|
|
+ rect.visible = false
|
|
|
+ img.visible = true
|
|
|
+ timeToAnimate.start()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// Rectangle{
|
|
|
// id: rect
|
|
|
// width: parent.width
|
|
@@ -107,7 +129,7 @@ Window {
|
|
|
function save() {
|
|
|
scheduleUpdate() // explicitly update. grabToImage() will force rendering afterwards.
|
|
|
sourceShader.grabToImage(function(result) {
|
|
|
- result.saveToFile("C://Documents/%1.png".arg(d.screenCount++));
|
|
|
+ d.images.push(result)
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -118,8 +140,26 @@ Window {
|
|
|
repeat: true
|
|
|
running: true
|
|
|
onTriggered: {
|
|
|
- sourceShader.save()
|
|
|
+// sourceShader.save()
|
|
|
+ source.grabToImage(function(result) {
|
|
|
+ d.images.push(result)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ Timer{
|
|
|
+ id: timeToAnimate
|
|
|
+
|
|
|
+ property int current: 0
|
|
|
+
|
|
|
+ interval: 25
|
|
|
+ repeat: true
|
|
|
+ running: false
|
|
|
+
|
|
|
+ onTriggered: {
|
|
|
+ if(current > d.images.length) current = 0
|
|
|
+ img.source = d.images[current++].url
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|