Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Scale image animation - performance issue
Forum Updated to NodeBB v4.3 + New Features

Scale image animation - performance issue

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 4.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtd1d1
    wrote on last edited by
    #1

    Hi,

    after reading this forum post: "performance images":http://developer.qt.nokia.com/wiki/Performance_tip_Images
    I wondered how is it possible to get a smooth and velvet scaling animation?

    Is there probably a possibility to improve the performance of my scaling animation?
    That's how I implemented it right now:

    That's the image
    @
    Image {
    id: item

                scale: 0.800
                clip: false
    
                anchors.left: tachoitem.left
                anchors.top: tachoitem.top
                anchors.leftMargin: 210
                anchors.topMargin: 30
    
    
                source: "images/item.png"
                sourceSize.width: 370
                sourceSize.height: 370
                smooth: true
    
            }@
    

    That's the Animation
    @ParallelAnimation {
    id: scaleoutLeft
    running: scaleout

                NumberAnimation { target: item; easing.type: Easing.InExpo;property: "x"; to: 100; duration: 1000 }
             
                NumberAnimation { target: item; property: "scale"; to: 1; duration: 1000 }
            }@
    

    Thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      diro
      wrote on last edited by
      #2

      What is your type of viewport? QGLWidget?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtd1d1
        wrote on last edited by
        #3

        Yes i am using qglwidget.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          Hi,

          One of the tips on the wiki is:

          bq. If you really need to enable Image.smooth, disable smooth filtering at the beginning of the animation and re-enable it at the end of the animation (scaling artifacts are only visible if the image is stationary on the screen)

          That is what I would suggest in this case. In general this looks something like:

          @
          SequentialAnimation {
          PropertyAction { target: item; property: "smooth"; value: false }
          NumberAnimation { target: item; property: "scale"; to: 1; duration: 1000 }
          PropertyAction { target: item; property: "smooth"; value: true }
          }
          @

          Regards,
          Michael

          1 Reply Last reply
          0
          • M Offline
            M Offline
            minimoog77
            wrote on last edited by
            #5

            Scaling of images when done on OpenGL is 'free'.

            But, notice that anchors/positions are reevaluated on every scale step, so I think performance issue when doing scaling are there (can somebody confirm?).

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qtd1d1
              wrote on last edited by
              #6

              Ok, I will try to turn off antialiasing during the animation and post the results later. Thank you

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved