如何在处理时间中显示GIF图像 [英] How to show a GIF image in Processing Time

查看:170
本文介绍了如何在处理时间中显示GIF图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经在Windows应用程序中开发了一个表单.
在我的表单中,我使用的是PictureBox控件来设置GIF图像.
我在任何处理事件中都称该图像,但正常图像中显示该图像.

如何以GIF格式显示该图像.

提前致谢.
:confused:

Hi All,

I have developed a form in windows application.
In my form I am using picturebox control to set a GIF image.
I call that image in any processing event but that image shown in normal image.

How to show that image in GIF format.

Advance Thanks.
:confused:

推荐答案

好.

标准的PictureBox控件可以显示动画GIF.
在窗体上创建一个PictureBox,将其Image属性设置为动画GIF,并将其Visible属性设置为false.
然后,当您要执行操作时,在代码中将PictureBox的Visible属性设置为true,执行该操作,然后再次将其设置为false.

注意:如果在UI线程上执行操作,则包括动画在内的表单将冻结,直到完成为止.要解决此问题,请查看BackgroundWorker 组件.

如果需要的话,很少有文章基于在另一个线程正在工作时显示动画的进度类型.
Ok.

The standard PictureBox control can display animated GIFs.
Make a PictureBox on your form, set its Image property to an animated GIF, and set its Visible property to false.
Then, when you want to perform your action, set the PictureBox''s Visible property to true in code, perform the action, and set it to false again.

Note: that if you perform your action on the UI thread, the form, including the animation, will freeze until it finishes. To solve this, look at the BackgroundWorker component.

If needed, there are few articles based on showing progress kind of animation while another thread is working.


这篇关于如何在处理时间中显示GIF图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆