This class encapsulates the concept of a platform-dependent animation.
An animation is a sequence of frames of the same size. Sound is not supported by wx.adv.Animation.
Note that on wxGTK wx.adv.Animation is capable of loading the formats supported by the internally-used gdk-pixbuf
library (typically this means only ANIMATION_TYPE_GIF
). On other platforms wx.adv.Animation is always capable of loading both GIF
and ANI
formats (i.e. both ANIMATION_TYPE_GIF
and ANIMATION_TYPE_ANI
).
See also
wx.adv.AnimationCtrl, Animation Sample
Default constructor. |
|
Returns the delay for the i-th frame in milliseconds. |
|
Returns the i-th frame as a wx.Image. |
|
Returns the number of frames for this animation. |
|
Returns the size of the animation. |
|
Returns |
|
Loads an animation from the given stream. |
|
Loads an animation from a file. |
wx.adv.
Animation
(Object)¶Possible constructors:
Animation()
Animation(anim)
Animation(name, type=ANIMATION_TYPE_ANY)
This class encapsulates the concept of a platform-dependent animation.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, anim)
Copy constructor.
anim (wx.adv.Animation) –
__init__ (self, name, type=ANIMATION_TYPE_ANY)
Loads an animation from a file.
name (string) – The name of the file to load.
type (AnimationType) – See LoadFile
for more info.
GetDelay
(self, i)¶Returns the delay for the i-th frame in milliseconds.
If -1
is returned the frame is to be displayed forever.
i (int) –
int
GetFrame
(self, i)¶Returns the i-th frame as a wx.Image.
This method is not implemented in the native wxGTK implementation of this class and always returns an invalid image there.
i (int) –
Image
GetFrameCount
(self)¶Returns the number of frames for this animation.
This method is not implemented in the native wxGTK implementation of this class and always returns 0 there.
int
IsOk
(self)¶Returns True
if animation data is present.
bool
Load
(self, stream, type=ANIMATION_TYPE_ANY)¶Loads an animation from the given stream.
stream (wx.InputStream) – The stream to use to load the animation. Under wxGTK may be any kind of stream; under other platforms this must be a seekable stream.
type (AnimationType) – One of the wx.adv.AnimationType enumeration values.
bool
True
if the operation succeeded, False
otherwise.
LoadFile
(self, name, type=ANIMATION_TYPE_ANY)¶Loads an animation from a file.
name (string) – A filename.
type (AnimationType) – One of the wx.adv.AnimationType values; wx.adv.ANIMATION_TYPE_ANY
means that the function should try to autodetect the filetype.
bool
True
if the operation succeeded, False
otherwise.
FrameCount
¶See GetFrameCount