Qyoto
4.0.6
Qyoto is a C# language binding for Qt
|
The QMovie class is a convenience class for playing movies with QImageReader. More...
Public Types | |
enum | CacheMode { CacheAll = 1, CacheNone = 0 } |
More... | |
enum | MovieState { NotRunning = 0, Paused = 1, Running = 2 } |
More... | |
Public Member Functions | |
QMovie (QObject parent=null) | |
| |
QMovie (QIODevice device) | |
| |
QMovie (QIODevice device, QByteArray format, QObject parent=null) | |
| |
QMovie (string fileName) | |
| |
QMovie (string fileName, QByteArray format, QObject parent=null) | |
| |
override void | CreateProxy () |
new bool | JumpToFrame (int frameNumber) |
| |
new void | SetPaused (bool paused) |
| |
new void | Start () |
| |
new void | Stop () |
| |
new void | Dispose () |
![]() | |
QObject (QObject parent=null) | |
| |
new bool | BlockSignals (bool b) |
| |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
new void | DeleteLater () |
| |
new bool | Disconnect (QObject receiver, string member=null) |
| |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
| |
new void | DumpObjectInfo () |
| |
new void | DumpObjectTree () |
| |
virtual bool | OnEvent (QEvent e) |
| |
virtual bool | EventFilter (QObject watched, QEvent @event) |
| |
new bool | Inherits (string classname) |
| |
new void | InstallEventFilter (QObject filterObj) |
| |
new void | KillTimer (int id) |
| |
new object | Property (string name) |
| |
new void | RemoveEventFilter (QObject obj) |
| |
new bool | SetProperty (string name, object value) |
| |
new void | SetUserData (uint id, QObjectUserData data) |
new int | StartTimer (int interval) |
| |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
![]() | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
Static Public Member Functions | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
![]() | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
| |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
| |
static string | Tr (string s, string c=null) |
| |
static string | Tr (string s, string c, int n) |
| |
static string | TrUtf8 (string s, string c=null) |
| |
static string | TrUtf8 (string s, string c, int n) |
| |
![]() | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream stream, QSizeF size) |
| |
static QDataStream | Write (QDataStream stream, QPoint point) |
| |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream stream, QLineF line) |
| |
static QDataStream | Write (QDataStream stream, QPointF point) |
| |
static QDataStream | Write (QDataStream @out, QChar chr) |
| |
static QDataStream | Write (QDataStream @out, QByteArray ba) |
| |
static QDataStream | Write (QDataStream stream, QEasingCurve easing) |
| |
static QDataStream | Write (QDataStream stream, QRectF rectangle) |
| |
static QDataStream | Write (QDataStream @out, QDateTime dateTime) |
| |
static QDataStream | Write (QDataStream @out, QUrl url) |
| |
static QDataStream | Write (QDataStream @out, QTime time) |
| |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream @out, QBitArray ba) |
| |
static QDataStream | Write (QDataStream s, QUuid id) |
| |
static QDataStream | Write (QDataStream stream, QLine line) |
| |
static QDataStream | Write (QDataStream @out, QDate date) |
| |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
| |
static QDataStream | Write (QDataStream stream, QRect rectangle) |
| |
static QDataStream | Write (QDataStream stream, QSize size) |
| |
static QDataStream | Write (QDataStream s, QVariant.Type p) |
static QDataStream | Write (QDataStream arg1, string arg2) |
static QDataStream | Write (QDataStream @out, System.Collections.Generic.List< string > list) |
| |
static QDataStream | Read (QDataStream @in, QChar chr) |
| |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream stream, QRect rectangle) |
| |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream @in, QDate date) |
| |
static QDataStream | Read (QDataStream @in, QUrl url) |
| |
static QDataStream | Read (QDataStream s, QUuid id) |
| |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream stream, QLineF line) |
| |
static QDataStream | Read (QDataStream stream, QRectF rectangle) |
| |
static QDataStream | Read (QDataStream stream, QPointF point) |
| |
static QDataStream | Read (QDataStream stream, QLine line) |
| |
static QDataStream | Read (QDataStream @in, QBitArray ba) |
| |
static QDataStream | Read (QDataStream stream, QSize size) |
| |
static QDataStream | Read (QDataStream @in, QDateTime dateTime) |
| |
static QDataStream | Read (QDataStream @in, QTime time) |
| |
static QDataStream | Read (QDataStream stream, QPoint point) |
| |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
| |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream @in, QByteArray ba) |
| |
static QDataStream | Read (QDataStream stream, QSizeF size) |
| |
static QDataStream | Read (QDataStream arg1, string arg2) |
static QDataStream | Read (QDataStream s, QVariant.Type p) |
static QDataStream | Read (QDataStream @in, System.Collections.Generic.List< string > list) |
| |
static double | QAcos (double v) |
| |
static void | QAddPostRoutine (System.Action ptr) |
| |
static double | QAsin (double v) |
| |
static double | QAtan (double v) |
| |
static double | QAtan2 (double x, double y) |
| |
static void | QBadAlloc () |
static int | QCeil (double v) |
| |
static ushort | QChecksum (string s, uint len) |
| |
static QByteArray | QCompress (QByteArray data, int compressionLevel=-1) |
| |
static QByteArray | QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
| |
static double | QCos (double v) |
| |
static double | QExp (double v) |
| |
static double | QFabs (double v) |
static double | QFastCos (double x) |
static double | QFastSin (double x) |
static string | QFlagLocation (string method) |
static int | QFloor (double v) |
| |
static bool | QFuzzyCompare (double p1, double p2) |
static bool | QFuzzyCompare (float p1, float p2) |
static bool | QFuzzyIsNull (double d) |
static bool | QFuzzyIsNull (float f) |
static uint | QHash (QBitArray key) |
| |
static uint | QHash (QChar key) |
| |
static uint | QHash (QStringRef key) |
static uint | QHash (QUrl url) |
| |
static uint | QHash (QPersistentModelIndex index) |
static uint | QHash (QByteArray key) |
| |
static uint | QHash (QModelIndex index) |
static uint | QHash (uint key) |
| |
static uint | QHash (char key) |
| |
static uint | QHash (byte key) |
| |
static uint | QHash (short key) |
| |
static uint | QHash (NativeLong key) |
| |
static uint | QHash (ushort key) |
| |
static uint | QHash (long key) |
| |
static uint | QHash (ulong key) |
| |
static uint | QHash (int key) |
| |
static uint | QHash (string key) |
| |
static uint | QHash (NativeULong key) |
| |
static Qt.ActionQtMsgTypeString | QInstallMsgHandler (Qt.ActionQtMsgTypeString arg1) |
static int | QIntCast (float f) |
static int | QIntCast (double f) |
static bool | QIsFinite (double d) |
static bool | QIsFinite (float f) |
static bool | QIsInf (float f) |
static bool | QIsInf (double d) |
static bool | QIsNaN (float f) |
static bool | QIsNaN (double d) |
static bool | QIsNull (float f) |
static bool | QIsNull (double d) |
static double | QLn (double v) |
| |
static double | QPow (double x, double y) |
| |
static void | QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
| |
static void | QRemovePostRoutine (System.Action arg1) |
static int | QRound (double d) |
static long | QRound64 (double d) |
static double | QSin (double v) |
| |
static double | QSqrt (double v) |
| |
static bool | QStringComparisonHelper (QStringRef s1, string s2) |
static double | QTan (double v) |
| |
static QByteArray | QUncompress (QByteArray data) |
| |
static QByteArray | QUncompress (Pointer< byte > data, int nbytes) |
| |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
static bool | Qputenv (string varName, QByteArray value) |
static void | Qsrand (uint seed) |
static int | Qstrcmp (QByteArray str1, QByteArray str2) |
static int | Qstrcmp (QByteArray str1, string str2) |
static int | Qstrcmp (string str1, QByteArray str2) |
static int | Qstrcmp (string str1, string str2) |
| |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
| |
static Pointer< sbyte > | Qstrdup (string src) |
| |
static int | Qstricmp (string str1, string str2) |
| |
static uint | Qstrlen (string str) |
| |
static int | Qstrncmp (string str1, string str2, uint len) |
| |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
| |
static int | Qstrnicmp (string str1, string str2, uint len) |
| |
static uint | Qstrnlen (string str, uint maxlen) |
| |
static string | QtTrId (string id, int n=-1) |
Protected Member Functions | |
QMovie (System.Type dummy) | |
new void | OnError (QImageReader.ImageReaderError error) |
| |
new void | OnFinished () |
| |
new void | OnFrameChanged (int frameNumber) |
| |
new void | OnResized (QSize size) |
| |
new void | OnStarted () |
| |
new void | OnStateChanged (QMovie.MovieState state) |
| |
new void | OnUpdated (QRect rect) |
| |
![]() | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent @event) |
| |
virtual void | ConnectNotify (string signal) |
| |
virtual void | OnCustomEvent (QEvent @event) |
| |
new void | OnDestroyed (QObject obj=null) |
| |
virtual void | DisconnectNotify (string signal) |
| |
new int | Receivers (string signal) |
| |
virtual void | OnTimerEvent (QTimerEvent @event) |
| |
Properties | |
Slot | Started |
| |
Slot< QSize > | Resized |
| |
Slot< QRect > | Updated |
| |
Slot< QMovie.MovieState > | StateChanged |
| |
Slot < QImageReader.ImageReaderError > | Error |
| |
Slot | Finished |
| |
Slot< System.Int32 > | FrameChanged |
| |
QColor | BackgroundColor [get, set] |
| |
QIODevice | Device [get, set] |
| |
string | FileName [get, set] |
| |
QByteArray | Format [get, set] |
| |
QSize | ScaledSize [get, set] |
| |
int | CurrentFrameNumber [get] |
| |
QImage | CurrentImage [get] |
| |
QPixmap | CurrentPixmap [get] |
| |
int | FrameCount [get] |
| |
QRect | FrameRect [get] |
| |
bool | IsValid [get] |
| |
bool | JumpToNextFrame [get] |
| |
int | LoopCount [get] |
| |
int | NextFrameDelay [get] |
| |
QMovie.MovieState | State [get] |
| |
static System.Collections.Generic.List < QByteArray > | SupportedFormats [get] |
| |
new int | Speed [get, set] |
| |
new CacheMode | cacheMode [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQMovieSignals | Emit [get] |
![]() | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | Event |
| |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
| |
Slot< QObject > | DestroyedQObject |
Slot | Destroyed |
| |
QObject | Parent [get, set] |
| |
System.Collections.Generic.List < QObject > | Children [get] |
| |
System.Collections.Generic.List < QByteArray > | DynamicPropertyNames [get] |
| |
bool | IsWidgetType [get] |
| |
static uint | RegisterUserData [get] |
QObject | Sender [get] |
| |
int | SenderSignalIndex [get] |
| |
bool | SignalsBlocked [get] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
| |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
![]() | |
static string | QAppName [get] |
static double | QInf [get] |
static double | QQNaN [get] |
static double | QSNaN [get] |
static bool | QSharedBuild [get] |
static string | QVersion [get] |
static int | Qrand [get] |
Additional Inherited Members | |
![]() | |
object | Q_EMIT = null |
SmokeInvocation | interceptor |
readonly List< QEventHandler > | eventFilters = new List<QEventHandler>() |
The QMovie class is a convenience class for playing movies with QImageReader.
This class is used to show simple animations without sound. If you want to display video and media content, use the Phonon multimedia framework instead.
First, create a QMovie object by passing either the name of a file or a pointer to a QIODevice containing an animated image format to QMovie's constructor. You can call isValid() to check if the image data is valid, before starting the movie. To start the movie, call start(). QMovie will enter Running state, and emit started() and stateChanged(). To get the current state of the movie, call state().
To display the movie in your application, you can pass your QMovie object to QLabel::setMovie(). Example:
QLabel label;
QMovie *movie = new QMovie("animations/fire.gif");
label.setMovie(movie);
movie->start();
Whenever a new frame is available in the movie, QMovie will emit updated(). If the size of the frame changes, resized() is emitted. You can call currentImage() or currentPixmap() to get a copy of the current frame. When the movie is done, QMovie emits finished(). If any error occurs during playback (i.e, the image file is corrupt), QMovie will emit error().
You can control the speed of the movie playback by calling setSpeed(), which takes the percentage of the original speed as an argument. Pause the movie by calling setPaused(true). QMovie will then enter Paused state and emit stateChanged(). If you call setPaused(false), QMovie will reenter Running state and start the movie again. To stop the movie, call stop().
Certain animation formats allow you to set the background color. You can call setBackgroundColor() to set the color, or backgroundColor() to retrieve the current background color.
currentFrameNumber() returns the sequence number of the current frame. The first frame in the animation has the sequence number 0. frameCount() returns the total number of frames in the animation, if the image format supports this. You can call loopCount() to get the number of times the movie should loop before finishing. nextFrameDelay() returns the number of milliseconds the current frame should be displayed.
QMovie can be instructed to cache frames of an animation by calling setCacheMode().
Call supportedFormats() for a list of formats that QMovie supports.
See also QLabel, QImageReader, and Movie Example.
This enum describes the different cache modes of QMovie.
This enum describes the different states of QMovie.
NotRunning |
The movie is not running. This is QMovie's initial state, and the state it enters after stop() has been called or the movie is finished. |
Paused |
The movie is paused, and QMovie stops emitting updated() or resized(). This state is entered after calling pause() or setPaused(true). The current frame number it kept, and the movie will continue with the next frame when unpause() or setPaused(false) is called. |
Running |
The movie is running. |
|
protected |
QtGui.QMovie.QMovie | ( | QObject | parent = null | ) |
Constructs a QMovie object, passing the parent object to QObject's constructor.
See also setFileName(), setDevice(), and setFormat().
QtGui.QMovie.QMovie | ( | QIODevice | device | ) |
Constructs a QMovie object. QMovie will use read image data from device, which it assumes is open and readable. If format is not empty, QMovie will use the image format format for decoding the image data. Otherwise, QMovie will attempt to guess the format.
The parent object is passed to QObject's constructor.
QtGui.QMovie.QMovie | ( | QIODevice | device, |
QByteArray | format, | ||
QObject | parent = null |
||
) |
Constructs a QMovie object. QMovie will use read image data from device, which it assumes is open and readable. If format is not empty, QMovie will use the image format format for decoding the image data. Otherwise, QMovie will attempt to guess the format.
The parent object is passed to QObject's constructor.
QtGui.QMovie.QMovie | ( | string | fileName | ) |
QtGui.QMovie.QMovie | ( | string | fileName, |
QByteArray | format, | ||
QObject | parent = null |
||
) |
|
virtual |
Reimplemented from QtCore.QObject.
new void QtGui.QMovie.Dispose | ( | ) |
new bool QtGui.QMovie.JumpToFrame | ( | int | frameNumber | ) |
Jumps to frame number frameNumber. Returns true on success; otherwise returns false.
|
protected |
|
protected |
This signal is emitted when the movie has finished.
See also QMovie::stop().
|
protected |
This signal is emitted when the frame number has changed to frameNumber. You can call currentImage() or currentPixmap() to get a copy of the frame.
This function was introduced in Qt 4.1.
|
protected |
This signal is emitted when the current frame has been resized to size. This effect is sometimes used in animations as an alternative to replacing the frame. You can call currentImage() or currentPixmap() to get a copy of the updated frame.
|
protected |
This signal is emitted after QMovie::start() has been called, and QMovie has entered QMovie::Running state.
|
protected |
This signal is emitted every time the state of the movie changes. The new state is specified by state.
See also QMovie::state().
|
protected |
This signal is emitted when the rect rect in the current frame has been updated. You can call currentImage() or currentPixmap() to get a copy of the updated frame.
new void QtGui.QMovie.SetPaused | ( | bool | paused | ) |
If paused is true, QMovie will enter Paused state and emit stateChanged(Paused); otherwise it will enter Running state and emit stateChanged(Running).
See also paused() and state().
new void QtGui.QMovie.Start | ( | ) |
Starts the movie. QMovie will enter Running state, and start emitting updated() and resized() as the movie progresses.
If QMovie is in the Paused state, this function is equivalent to calling setPaused(false). If QMovie is already in the Running state, this function does nothing.
See also stop() and setPaused().
new void QtGui.QMovie.Stop | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
getset |
Returns the background color of the movie. If no background color has been assigned, an invalid QColor is returned.
For image formats that support it, this function sets the background color to color.
|
getset |
This property holds the movie's cache mode.
Caching frames can be useful when the underlying animation format handler that QMovie relies on to decode the animation data does not support jumping to particular frames in the animation, or even "rewinding" the animation to the beginning (for looping). Furthermore, if the image data comes from a sequential device, it is not possible for the underlying animation handler to seek back to frames whose data has already been read (making looping altogether impossible).
To aid in such situations, a QMovie object can be instructed to cache the frames, at the added memory cost of keeping the frames in memory for the lifetime of the object.
By default, this property is set to CacheNone.
|
get |
Returns the sequence number of the current frame. The number of the first frame in the movie is 0.
|
get |
Returns the current frame as a QImage.
See also currentPixmap() and updated().
|
get |
Returns the current frame as a QPixmap.
See also currentImage() and updated().
|
getset |
|
getprotected |
|
addremove |
|
getset |
|
addremove |
This signal is emitted when the movie has finished.
See also QMovie::stop().
|
getset |
Returns the format that QMovie uses when decoding image data. If no format has been assigned, an empty QByteArray() is returned.
Sets the format that QMovie will use when decoding image data, to format. By default, QMovie will attempt to guess the format of the image data.
You can call supportedFormats() for the full list of formats QMovie supports.
|
addremove |
This signal is emitted when the frame number has changed to frameNumber. You can call currentImage() or currentPixmap() to get a copy of the frame.
This function was introduced in Qt 4.1.
|
get |
Returns the number of frames in the movie.
Certain animation formats do not support this feature, in which case 0 is returned.
|
get |
Returns the rect of the last frame. If no frame has yet been updated, an invalid QRect is returned.
See also currentImage() and currentPixmap().
|
get |
Returns true if the movie is valid (e.g., the image data is readable and the image format is supported); otherwise returns false.
|
get |
Jumps to the next frame. Returns true on success; otherwise returns false.
|
get |
Returns the number of times the movie will loop before it finishes. If the movie will only play once (no looping), loopCount returns 0. If the movie loops forever, loopCount returns -1.
Note that, if the image data comes from a sequential device (e.g. a socket), QMovie can only loop the movie if the cacheMode is set to QMovie::CacheAll.
|
get |
Returns the number of milliseconds QMovie will wait before updating the next frame in the animation.
|
addremove |
This signal is emitted when the current frame has been resized to size. This effect is sometimes used in animations as an alternative to replacing the frame. You can call currentImage() or currentPixmap() to get a copy of the updated frame.
|
getset |
Returns the scaled size of frames.
This function was introduced in Qt 4.1.
Sets the scaled frame size to size.
This function was introduced in Qt 4.1.
|
getset |
This property holds the movie's speed.
The speed is measured in percentage of the original movie speed. The default speed is 100%. Example:
QMovie movie("racecar.gif");
movie.setSpeed(200); // 2x speed
|
addremove |
This signal is emitted after QMovie::start() has been called, and QMovie has entered QMovie::Running state.
|
get |
Returns the current state of QMovie.
See also MovieState and stateChanged().
|
addremove |
This signal is emitted every time the state of the movie changes. The new state is specified by state.
See also QMovie::state().
|
staticget |
|
staticget |
Returns the list of image formats supported by QMovie.
This function was introduced in Qt 4.1.
See also QImageReader::supportedImageFormats().
|
addremove |
This signal is emitted when the rect rect in the current frame has been updated. You can call currentImage() or currentPixmap() to get a copy of the updated frame.