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. Fade in/out images on low resources device
Forum Updated to NodeBB v4.3 + New Features

Fade in/out images on low resources device

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 2.3k Views 2 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I need to fade in/out two images on a simple QML application that runs on a BeagleBone Black board.

    At the moment I tried with two Images (same size and same position) and changing the opacity of the first with a NumberAnimation.

    It works well on a Desktop PC but on a linux embedded board it isn't very good to see, it's not so smooth.

    What is the best way to fade images without the need of a lot of graphics resources?

    Thanks

    Julien BJ 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Could an Animator help here, perhaps? http://doc.qt.io/qt-5/qml-qtquick-animator.html

      (Z(:^

      L 1 Reply Last reply
      2
      • L luca

        Hi all,
        I need to fade in/out two images on a simple QML application that runs on a BeagleBone Black board.

        At the moment I tried with two Images (same size and same position) and changing the opacity of the first with a NumberAnimation.

        It works well on a Desktop PC but on a linux embedded board it isn't very good to see, it's not so smooth.

        What is the best way to fade images without the need of a lot of graphics resources?

        Thanks

        Julien BJ Offline
        Julien BJ Offline
        Julien B
        wrote on last edited by Julien B
        #3

        Hello @luca,

        Have you an exemple of the full QML code you are using?

        edit: It was usefull for me to use this FPS indicator to check performances.

        1 Reply Last reply
        0
        • sierdzioS sierdzio

          Could an Animator help here, perhaps? http://doc.qt.io/qt-5/qml-qtquick-animator.html

          L Offline
          L Offline
          luca
          wrote on last edited by
          #4

          @sierdzio Thanks, using an OpacityAnimator it seems soother than a NumberAnimation on opacity.

          @Julien-B The code is very simple. Two Images and the animator on the opacity of the first image:

          Image {
                  id: image1
                  src: XXXXX
                  anchors.fill: parent
          }
          
          Image {
                  id: image0
                  src: YYYYY
                  anchors.fill: parent
          }
          
          OpacityAnimator {
                
                  target: image0
                  from: 1
                  to: 0
                  duration: 1000
                  running: false
              }
          
          

          Than I have a qml function called from C++ that start the animation when required.

          Julien BJ 1 Reply Last reply
          1
          • L luca

            @sierdzio Thanks, using an OpacityAnimator it seems soother than a NumberAnimation on opacity.

            @Julien-B The code is very simple. Two Images and the animator on the opacity of the first image:

            Image {
                    id: image1
                    src: XXXXX
                    anchors.fill: parent
            }
            
            Image {
                    id: image0
                    src: YYYYY
                    anchors.fill: parent
            }
            
            OpacityAnimator {
                  
                    target: image0
                    from: 1
                    to: 0
                    duration: 1000
                    running: false
                }
            
            

            Than I have a qml function called from C++ that start the animation when required.

            Julien BJ Offline
            Julien BJ Offline
            Julien B
            wrote on last edited by Julien B
            #5

            @luca ,

            Do you use any graphical effects in your application?

            Do you have the possibility to put some item visibility to false when not used or not visible on screen?

            I found a lot of infos in Performance Considerations And Suggestions ans some tips worked in our case.

            L 1 Reply Last reply
            3
            • Julien BJ Julien B

              @luca ,

              Do you use any graphical effects in your application?

              Do you have the possibility to put some item visibility to false when not used or not visible on screen?

              I found a lot of infos in Performance Considerations And Suggestions ans some tips worked in our case.

              L Offline
              L Offline
              luca
              wrote on last edited by
              #6

              @Julien-B Thanks for the link!
              Reading the doc seems it's better for me to set visibility to false when animator ends.
              I'll try to see if there are improvements.

              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