简体   繁体   English

c#如何在图片框中制作我的gif动画循环

[英]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. 我已将动画GIF作为资源导入到图片框中 - 不幸的是它只播放到结束帧并且从不重复。 Id there something I could do to make it loop continiously. 我可以做些什么来让它不断循环。 The gif is for my "please wait busy box" gif是我的“请等待忙碌的盒子”

Brad 布拉德

Animated GIFs have a few different settings. 动画GIF有几个不同的设置。 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. 几个程序用于编辑动画GIF并更改循环设置。

First, I'd open your GIF in some app to preview it to see if it loops before trying to alter the image. 首先,我会在某个应用程序中打开您的GIF,以便在尝试更改图像之前预览它是否循环。

You can use the System.Drawing.ImageAnimator class helper. 您可以使用System.Drawing.ImageAnimator类助手。 You have the Animate, UpdateFrames, and StopAnimate methods to control the loop. 您可以使用Animate,UpdateFrames和StopAnimate方法来控制循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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