如何在Windows窗体(c#)上显示动画GIF?(How do you show animated GIFs on a Windows Form (c#))

系统教程 行业动态 更新时间:2024-06-14 17:02:18
如何在Windows窗体(c#)上显示动画GIF?(How do you show animated GIFs on a Windows Form (c#))

我有一个表单显示进度消息作为一个相当长的过程运行。 这是一个网络服务的呼叫,所以我无法真正显示进度条上的百分比完整数字。 (我不是特别喜欢进度条的Marquee属性)

我想展示一个动画GIF,让进程有一些活动的感觉(例如,从一台计算机到另一台计算机的文件,如Windows复制过程)。

你怎么做到这一点?

I have a form showing progress messages as a fairly long process runs. It's a call to a web service so I can't really show a percentage complete figure on a progress bar meaningfully. (I don't particularly like the Marquee property of the progress bar)

I would like to show an animated GIF to give the process the feel of some activity (e.g. files flying from one computer to another like Windows copy process).

How do you do this?

最满意答案

这不是太难了

将一个picturebox放在你的表单上。 在图片框中添加.gif文件作为图像 加载时显示图片框。

需要考虑的事项:

禁用图片框将阻止gif动画化。

动画GIF:

如果您正在寻找动画GIF,您可以在这里生成

另一种做法:

我发现工作得很好的另一种方法是在代码项目中找到的异步对话框控件

It's not too hard.

Drop a picturebox onto your form. Add the .gif file as the image in the picturebox Show the picturebox when you are loading.

Things to take into consideration:

Disabling the picturebox will prevent the gif from being animated.

Animated gifs:

If you are looking for animated gifs you can generate them here

Another way of doing it:

Another way that I have found that works quite well is the async dialog control that I found on the code project

更多推荐

本文发布于:2023-04-21 18:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/c38cb63650602929e21f080a756930f0.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   动画   如何在   Windows   GIF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!