Qt 4.8
AnimatedImage Class Reference

The AnimatedImage element extends the features of the Image element, providing a way to play animations stored as images containing a series of frames, such as those stored in GIF files. More...

Inheritance diagram for AnimatedImage:
Image Item

Detailed Description

The AnimatedImage element extends the features of the Image element, providing a way to play animations stored as images containing a series of frames, such as those stored in GIF files.

Since
4.7

Information about the current frame and totla length of the animation can be obtained using the currentFrame and frameCount properties. You can start, pause and stop the animation by changing the values of the playing and paused properties.

The full list of supported formats can be determined with QMovie::supportedFormats().

Example Usage

animatedimageitem.gif

The following QML shows how to display an animated image and obtain information about its state, such as the current frame and total number of frames. The result is an animated image with a simple progress indicator underneath it.

import QtQuick 1.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"
}
}
See also
BorderImage, Image

The documentation for this class was generated from the following file: