C# How to stop animated gif from continually looping

You can extract single frame from that GIF image (non - animated) when the progress event is done,

txImage.Image = Image.FormFile("non-animated-frame-from-gif.jpg");

You can use this website to extract frame from gif : http://gif-explode.com/


You could always encapsulate the image/gif inside a Picturebox, and when you want the gif to stop, just set the Enabled property of the Picturebox to false.

Just a thought.


You could use the System.Drawing.ImageAnimator to start/stop the gif animation

// start
System.Drawing.ImageAnimator.Animate(txImage.Image, OnFrameChanged);

// stop
System.Drawing.ImageAnimator.StopAnimate(txImage.Image, OnFrameChanged);

private void OnFrameChanged(object sender, EventArgs e)
{
   // frame change
}