Click to See Complete Forum and Search --> : stop an animated gif


blatantkilling
March 13th, 2003, 12:08 AM
hi. i'm trying to find a way to stop an animated gif from replaying in C#. it appears that there's no way to just stop it when it loads the last frame. i've already tried the getframecount method and then onPaint() i'd increase a current_frame_count variable until it reaches the frame_count and then i'd disable the image.

private void Label_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
currentFrame++;
if(currentFrame.CompareTo(frameCount) == 0)
{
this.Innisfree_Logo.Enabled = false;
}
}

now that works, but only if the system that's running doesn't stall for a sec or runs anything heavy. and that's the problem. i can't have this image stoping on a different spot just cause the system runs a little heavier. (the reason it stops is cause a gif runs on a framedimension.time type, not page). i need a better and safe method to actually stop the gif image on the last frame. if anyone can help, this would be great. thanks.

pareshgh
March 13th, 2003, 01:34 PM
actually GIF architecture is diff. since it has layers which can be merged. so try looking its details in Adobe first (or gif modifier s/w) then fetch for the frame image and show that out.

may be that can work,
just a thought though

Paresh