phoenix_title 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 Class Hierarchy

Inheritance diagram for class Animation:

method_summary Methods Summary

__init__

Constructs a new empty animation object.

AddHandler

Add a new decoder to the list of animation decoders.

CleanUpHandlers

Clear out the animation decoder list.

FindHandler

Search for an animation decoder by type.

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.

GetHandlers

Returns the list of animation decoders used by the generic animation and wx.adv.GenericAnimationCtrl.

GetSize

Returns the size of the animation.

InitStandardHandlers

Load the stock animation decoders (currently GIF and ANI) into the list of decoders.

InsertHandler

Insert a new decoder to the front of the list of animation decoders.

IsCompatibleWith

Returns True if animation can be used with controls of the given type.

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


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Constructs a new empty animation object.

Call Load to initialize it.



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



__init__ (self, other)

Copy constructor.

Parameters

other (wx.adv.Animation) –





static AddHandler(handler)

Add a new decoder to the list of animation decoders.

Parameters

handler (wx.adv.AnimationDecoder) –



static CleanUpHandlers()

Clear out the animation decoder list.

This is called automatically at program shutdown.



static FindHandler(animType)

Search for an animation decoder by type.

Parameters

animType (AnimationType) –

Return type

wx.adv.AnimationDecoder



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



GetSize(self)

Returns the size of the animation.

Return type

Size



static InitStandardHandlers()

Load the stock animation decoders (currently GIF and ANI) into the list of decoders.

This is called automatically at program startup.



static InsertHandler(handler)

Insert a new decoder to the front of the list of animation decoders.

Parameters

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.

Parameters

ci (wx.ClassInfo) –

Return type

bool

New 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



Size

See GetSize