- m_gifTimer = new wxGIFTimer(this);
- m_gifTimer->Start(m_gifDecoder->GetDelay(), TRUE);
+ m_gifDecoder = new wxGIFDecoder(s, TRUE);
+ if ( m_gifDecoder->ReadGIF() == wxGIF_OK )
+ {
+ wxImage img;
+ if ( m_gifDecoder->ConvertToImage(&img) )
+ SetImage(img);
+
+ readImg = FALSE;
+
+ if ( m_gifDecoder->IsAnimation() )
+ {
+ m_gifTimer = new wxGIFTimer(this);
+ m_gifTimer->Start(m_gifDecoder->GetDelay(), TRUE);
+ }
+ else
+ {
+ wxDELETE(m_gifDecoder);
+ }
+ }
+ else
+ {
+ wxDELETE(m_gifDecoder);
+ }