Guest User

Untitled

a guest
Jun 25th, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 2.11
  2. import QtQuick.Window 2.11
  3.  
  4. Window {
  5.     id: window
  6.     visible: true
  7.     width: 640
  8.     height: 480
  9.     title: qsTr("Hello World")
  10.  
  11.     QtObject{
  12.         id: d
  13.  
  14.         property int screenCount: 0
  15.         property var images: []
  16.     }
  17.  
  18.  
  19.     Item{
  20.         id: source
  21.         width:  parent.width
  22.         height: parent.height
  23.  
  24.         // Simple Animation
  25.  
  26.         Rectangle{
  27.             id: rect
  28.  
  29.             width: 20
  30.             height: 20
  31.             x: 10
  32.             y: 10
  33.  
  34.             color: "black"
  35.             radius: width
  36.             visible: true
  37.         }
  38.  
  39.         SequentialAnimation{
  40.             id: moveAnimation
  41.             running: true
  42.             loops: Animation.Infinite
  43.             PropertyAnimation{target: rect; property: "x"; to: source.width - rect.width - 10; duration: 2000}
  44.             PropertyAnimation{target: rect; property: "y"; to: source.height - rect.height - 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
  45.             PropertyAnimation{target: rect; property: "x"; to: 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
  46.             PropertyAnimation{target: rect; property: "y"; to: 10; duration: 2000/*; easing.type: Easing.OutCirc*/}
  47.         }
  48.  
  49.  
  50.         Image {
  51.             id: img
  52.             anchors.fill: parent
  53.             mipmap: true
  54.             asynchronous: true
  55.             visible: false
  56.         }
  57.  
  58.     Timer{
  59.         id: timeToScreenShoot
  60.         interval: 25
  61.         repeat: true
  62.         running: true
  63.         onTriggered: {
  64.             source.grabToImage(function(result) {
  65.                         // DO SOMETHINK
  66.                         })
  67.         }
  68.     }
Advertisement
Add Comment
Please, Sign In to add comment