Image animation stops on minimizing and restoring

Posted by lc on Stack Overflow See other posts from Stack Overflow or by lc
Published on 2009-06-04T06:28:32Z Indexed on 2010/03/24 17:43 UTC
Read the original article Hit count: 163

I have a .NET WinForms application with an animated GIF in a PictureBox. It's a loading animation, shown while a BackgroundWorker does some processing in another thread. I load the image by setting the Image property and it animates on its own.

All is fine until I minimize and restore the application. At which point, the image stops animating and just displays whatever frame it was last on.

Note that:

  • The background thread still runs fine and none of the "business" of the application is affected.
  • Subsequently-displayed animated GIFs do work fine (unless the application is minimized again).

Does anyone know what causes this problem? Any workarounds?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms