// Draw all intermediate frames that haven't been removed from the
// animation
int i;
- for (i = 0; i < (frame - 1); i++)
+ for (i = 0; i < frame; i++)
{
if ((GetDisposalMethod(i) == wxANIM_DONOTREMOVE) || (GetDisposalMethod(i) == wxANIM_UNSPECIFIED))
{
PlayFrame(GetCurrentFrame(), * GetWindow(), GetPosition());
// Set the timer for the next frame
- m_timer.Start(GetDelay(GetCurrentFrame()));
+ int delay = GetDelay(GetCurrentFrame());
+ if (delay == 0)
+ delay = 1; // 0 is invalid timeout for wxTimer.
+
+ m_timer.Start(delay);
m_currentFrame ++;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
wxImage* image = new wxImage;
m_decoder->ConvertToImage(image);
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
int disposalMethod = m_decoder->GetDisposalMethod();
return (wxAnimationDisposal) disposalMethod;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
wxRect rect(m_decoder->GetLeft(), m_decoder->GetTop(), m_decoder->GetWidth(), m_decoder->GetHeight());
return rect;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
return m_decoder->GetDelay();
}
m_animationPlayer.SetPosition(wxPoint(0, 0));
m_animationPlayer.SetDestroyAnimation(FALSE);
+ LoadFile(filename);
+
return TRUE;
}