The wx.adv.Animation class handles the interface between the animation control and the details of the animation image or data.
See also
wx.adv.AnimationCtrl, Animation Sample
Constructs a new empty animation object. |
|
Add a new decoder to the list of animation decoders. |
|
Clear out the animation decoder list. |
|
Search for an animation decoder by type. |
|
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 list of animation decoders used by the generic animation and wx.adv.GenericAnimationCtrl. |
|
Returns the size of the animation. |
|
Load the stock animation decoders (currently |
|
Insert a new decoder to the front of the list of animation decoders. |
|
Returns |
|
Returns |
|
Loads an animation from the given stream. |
|
Loads an animation from a file. |
See |
|
See |
wx.adv.
Animation
(Object)¶Possible constructors:
Animation()
Animation(name, type=ANIMATION_TYPE_ANY)
Animation(other)
The Animation class handles the interface between the animation control and the details of the animation image or data.
__init__
(self, *args, **kw)¶__init__ (self)
Constructs a new empty animation object.
Call Load
to initialize it.
See also
wx.adv.AnimationCtrl.CreateAnimation
__init__ (self, name, type=ANIMATION_TYPE_ANY)
Constructs a new animation object and load the animation data from the given filename.
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.
See also
wx.adv.AnimationCtrl.CreateAnimation
__init__ (self, other)
Copy constructor.
other (wx.adv.Animation) –
AddHandler
(handler)¶Add a new decoder to the list of animation decoders.
handler (wx.adv.AnimationDecoder) –
CleanUpHandlers
()¶Clear out the animation decoder list.
This is called automatically at program shutdown.
FindHandler
(animType)¶Search for an animation decoder by type.
animType (AnimationType) –
GetDelay
(self, frame)¶Returns the delay for the i-th frame in milliseconds.
If -1
is returned the frame is to be displayed forever.
frame (int) –
int
GetFrame
(self, frame)¶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.
frame (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
GetHandlers
()¶Returns the list of animation decoders used by the generic animation and wx.adv.GenericAnimationCtrl.
AnimationDecoderList
InitStandardHandlers
()¶Load the stock animation decoders (currently GIF
and ANI
) into the list of decoders.
This is called automatically at program startup.
InsertHandler
(handler)¶Insert a new decoder to the front of the list of animation decoders.
handler (wx.adv.AnimationDecoder) –
IsCompatibleWith
(self, ci)¶Returns True
if animation can be used with controls of the given type.
This function checks if this animation object can be used with wx.adv.AnimationCtrl of particular type. This will be always the case for the platforms where only a single wx.adv.AnimationCtrl implementation is available, but not necessarily under e.g. wxGTK where both native (but limited) GTK implementation and generic implementation can be used.
ci (wx.ClassInfo) –
bool
New in version 4.1/wxWidgets-3.1.4.
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