Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

AnimatedImage

Inherits Image

Properties

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.

Information about the current frame and total 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

[Missing image 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.

Note: Unlike images, animated images are not cached or shared internally.


 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"
     }
 }

See also BorderImage and Image.

Property Documentation

asynchronous : bool

Specifies that images on the local filesystem should be loaded asynchronously in a separate thread. The default value is false, causing the user interface thread to block while the image is loaded. Setting asynchronous to true is useful where maintaining a responsive user interface is more desirable than having images immediately visible.

Note that this property is only valid for images read from the local filesystem. Images loaded via a network resource (e.g. HTTP) are always loaded asynchronously.


currentFrame : int

frameCount : int

currentFrame is the frame that is currently visible. By monitoring this property for changes, you can animate other items at the same time as the image.

frameCount is the number of frames in the animation. For some animation formats, frameCount is unknown and has a value of zero.


mirror : bool

This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image).

The default value is false.


paused : bool

This property holds whether the animated image is paused.

By default, this property is false. Set it to true when you want to pause the animation.


playing : bool

This property holds whether the animated image is playing.

By default, this property is true, meaning that the animation will start playing immediately.


source : url

This property holds the URL that refers to the source image.

AnimatedImage can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.

See also QQuickImageProvider.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web