Solved Fade in/out images on low resources device
-
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
-
Could an Animator help here, perhaps? http://doc.qt.io/qt-5/qml-qtquick-animator.html
-
-
@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.
-
@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.
-
@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.