PDA

View Full Version : How to change speed Animated Image in qml?



tanthinh1510
16th July 2015, 03:19
Hi!
I create simple example using AnimatedImage as below:

import QtQuick 2.0

Rectangle {
width: animation.width; height: animation.height + 8

AnimatedImage { id: animation; source: "animation.gif" }

Rectangle {
property int frames: animation.frameCount

width: 4; height: 8
x: (animation.width - width) * animation.currentFrame / frames
y: animation.height
color: "red"
}
}
And now, I have slider, when I changed slider value then speed AnimatedImage changed(increase or decrease)
How to do it?
Thanks!