Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.11
- import QtQuick.Window 2.11
- Window {
- id: window
- visible: true
- width: 640
- height: 480
- title: qsTr("Hello World")
- QtObject{
- id: d
- property int screenCount: 0
- property var images: []
- }
- Item{
- id: source
- width: parent.width
- height: parent.height
- // Simple Animation
- Rectangle{
- id: rect
- width: 20
- height: 20
- x: 10
- y: 10
- color: "black"
- radius: width
- visible: true
- }
- SequentialAnimation{
- id: moveAnimation
- running: true
- loops: Animation.Infinite
- PropertyAnimation{target: rect; property: "x"; to: source.width - rect.width - 10; duration: 2000}
- PropertyAnimation{target: rect; property: "y"; to: source.height - rect.height - 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
- PropertyAnimation{target: rect; property: "x"; to: 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
- PropertyAnimation{target: rect; property: "y"; to: 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
- }
- Image {
- id: img
- anchors.fill: parent
- mipmap: true
- asynchronous: true
- visible: false
- }
- Timer{
- id: timeToScreenShoot
- interval: 25
- repeat: true
- running: true
- onTriggered: {
- source.grabToImage(function(result) {
- // DO SOMETHINK
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment