简体   繁体   中英

c# How can I make my gif animation loop in a picturebox

I have imported an animated GIF as a resource into a picturebox - unfortunitly it only plays to the end frame and never repeats. Id there something I could do to make it loop continiously. The gif is for my "please wait busy box"

Brad

Animated GIFs have a few different settings. Usually, embedded in the file is some data that tells the renderer how the image should be displayed.

This data says how fast the image is animated, if it should loop infinitely, or how many times it should repeat.

There are several programs available that you can use to edit an animated GIF and change the looping settings.

First, I'd open your GIF in some app to preview it to see if it loops before trying to alter the image.

You can use the System.Drawing.ImageAnimator class helper. You have the Animate, UpdateFrames, and StopAnimate methods to control the loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM