Contents Up Previous Next

wxAnimation

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

Derived from

wxGDIObject
wxObject

Include files

<wx/animate.h>

Predefined objects

Objects:

wxNullAnimation

See also

wxAnimationCtrl

Members

wxAnimation::wxAnimation
wxAnimation::~wxAnimation
wxAnimation::GetDelay
wxAnimation::GetFrameCount
wxAnimation::GetFrame
wxAnimation::GetSize
wxAnimation::IsOk
wxAnimation::Load
wxAnimation::LoadFile
wxAnimation::operator =


wxAnimation::wxAnimation

wxAnimation()

Default constructor.

wxAnimation(const wxAnimation& anim)

Copy constructor, uses reference counting.

wxAnimation(const wxString& name, wxAnimationType type = wxANIMATION_TYPE_ANY)

Loads an animation from a file.

name

type


wxAnimation::~wxAnimation

~wxAnimation()

Destructor. See reference-counted object destruction for more info.


wxAnimation::GetDelay

int GetDelay(unsigned int i) const

Returns the delay for the i-th frame in milliseconds. If -1 is returned the frame is to be displayed forever.


wxAnimation::GetFrameCount

unsigned int GetFrameCount() const

Returns the number of frames for this animation.


wxAnimation::GetFrame

wxImage GetFrame(unsigned int i) const

Returns the i-th frame as a wxImage.


wxAnimation::GetSize

wxSize GetSize() const

Returns the size of the animation.


wxAnimation::IsOk

bool IsOk() const

Returns true if animation data is present.


wxAnimation::Load

bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY)

Loads an animation from the given stream.

Parameters

stream

type

Return value

true if the operation succeeded, false otherwise.


wxAnimation::LoadFile

bool LoadFile(const wxString& name, wxAnimationType type = wxANIMATION_TYPE_ANY)

Loads an animation from a file.

Parameters

name

type

Return value

true if the operation succeeded, false otherwise.


wxAnimation::operator =

wxAnimation& operator =(const wxAnimation& brush)

Assignment operator, using reference counting.