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
Include files
<wx/animate.h>
Predefined objects
Objects:
wxNullAnimation
See also
Members
wxAnimation::wxAnimation
wxAnimation::~wxAnimation
wxAnimation::GetDelay
wxAnimation::GetFrameCount
wxAnimation::GetFrame
wxAnimation::GetSize
wxAnimation::IsOk
wxAnimation::Load
wxAnimation::LoadFile
wxAnimation::operator =
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()
Destructor. See reference-counted object destruction for more info.
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.
unsigned int GetFrameCount() const
Returns the number of frames for this animation.
wxImage GetFrame(unsigned int i) const
Returns the i-th frame as a wxImage.
wxSize GetSize() const
Returns the size of the animation.
bool IsOk() const
Returns true if animation data is present.
bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY)
Loads an animation from the given stream.
Parameters
stream
type
wxANIMATION_TYPE_GIF | Load an animated GIF file. |
wxANIMATION_TYPE_ANI | Load an ANI file. |
wxANIMATION_TYPE_ANY | Try to autodetect the filetype. |
Return value
true if the operation succeeded, false otherwise.
bool LoadFile(const wxString& name, wxAnimationType type = wxANIMATION_TYPE_ANY)
Loads an animation from a file.
Parameters
name
type
wxANIMATION_TYPE_GIF | Load an animated GIF file. |
wxANIMATION_TYPE_ANI | Load an ANI file. |
wxANIMATION_TYPE_ANY | Try to autodetect the filetype. |
Return value
true if the operation succeeded, false otherwise.
wxAnimation& operator =(const wxAnimation& brush)
Assignment operator, using reference counting.