Phoenix Logo

phoenix_title wx.adv.Animation

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


class_hierarchy Class Hierarchy

Inheritance diagram for class Animation:


method_summary Methods Summary

__init__ Default constructor.
GetDelay Returns the delay for the i-th frame in milliseconds.
GetFrame Returns the i-th frame as a wx.Image.
GetFrameCount Returns the number of frames for this animation.
GetSize Returns the size of the animation.
IsOk Returns True if animation data is present.
Load Loads an animation from the given stream.
LoadFile Loads an animation from a file.

property_summary Properties Summary

FrameCount See GetFrameCount
Size See GetSize

api Class API



class 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.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.



__init__ (self, anim)

Copy constructor.

Parameters:anim (wx.adv.Animation) –



__init__ (self, name, type=ANIMATION_TYPE_ANY)

Loads an animation from a file.

Parameters:





GetDelay(self, i)

Returns the delay for the i-th frame in milliseconds.

If -1 is returned the frame is to be displayed forever.

Parameters:i (int) –
Return type: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.

Parameters:i (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


GetSize(self)

Returns the size of the animation.

Return type:Size


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



Size

See GetSize