wx.adv.Animation¶
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
Class Hierarchy¶
Methods Summary¶
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. |
Properties Summary¶
See |
|
See |
Class API¶
- class wx.adv.Animation(Object)¶
Possible constructors:
Animation() -> None Animation(name, type=ANIMATION_TYPE_ANY) -> None Animation(other) -> None
The Animation class handles the interface between the animation control and the details of the animation image or data.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Constructs a new empty animation object.
Call
Load
to initialize it.- Return type:
None
See also
__init__ (self, name, type=ANIMATION_TYPE_ANY)
Constructs a new animation object and load the animation data from the given filename.
- Parameters:
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.
- Return type:
None
See also
__init__ (self, other)
Copy constructor.
- Parameters:
other (wx.adv.Animation)
- Return type:
None
- static AddHandler(handler)¶
Add a new decoder to the list of animation decoders.
- Parameters:
handler (wx.adv.AnimationDecoder)
- Return type:
None
- static CleanUpHandlers()¶
Clear out the animation decoder list.
This is called automatically at program shutdown.
- Return type:
None
- static FindHandler(animType)¶
Search for an animation decoder by type.
- Parameters:
animType (AnimationType)
- Return type:
- GetDelay(self, frame)¶
Returns the delay for the i-th frame in milliseconds.
If
-1
is returned the frame is to be displayed forever.- Parameters:
frame (int)
- Return type:
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.
- Parameters:
frame (int)
- Return type:
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.
- Return type:
int
- static GetHandlers()¶
Returns the list of animation decoders used by the generic animation and wx.adv.GenericAnimationCtrl.
- Return type:
AnimationDecoderList
- static InitStandardHandlers()¶
Load the stock animation decoders (currently
GIF
andANI
) into the list of decoders.This is called automatically at program startup.
- Return type:
None
- static InsertHandler(handler)¶
Insert a new decoder to the front of the list of animation decoders.
- Parameters:
handler (wx.adv.AnimationDecoder)
- Return type:
None
- 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.
- Parameters:
ci (wx.ClassInfo)
- Return type:
bool
Added in version 4.1/wxWidgets-3.1.4.
- IsOk(self)¶
Returns
True
if animation data is present.- Return type:
bool
- Load(self, stream, type=ANIMATION_TYPE_ANY)¶
Loads an animation from the given stream.
- Parameters:
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.
- Return type:
bool
- Returns:
True
if the operation succeeded,False
otherwise.
- LoadFile(self, name, type=ANIMATION_TYPE_ANY)¶
Loads an animation from a file.
- Parameters:
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.
- Return type:
bool
- Returns:
True
if the operation succeeded,False
otherwise.
Properties¶
- FrameCount¶
See
GetFrameCount