Winforms中的GIF动画 [英] Animated GIF in Winforms

查看:117
本文介绍了Winforms中的GIF动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在应用程序中使用了动画GIF.实际上,这个过程需要花费很长时间,我希望向用户展示一些东西以显示进度.
我放了一个图片框,然后放了动画GIF.可见属性设置为false.
当用户单击保存"按钮时,其可见属性设置为true,但动画不显示.
请告知可能是什么问题.
致谢
Furqan

Hi,
I have used animated GIF in my application. Actually there is a process that takes quite long and I wish to show something to the user to show progress.
I have put a picture box and put animated GIF. It is visible property is set to false.
When user clicks on Save button, its visible property is set to true but animation does not show up.
Please advise what could be the problem.
Thnaks
Furqan

推荐答案

它不会显示,因为您正在尝试更新动画GIF并保存在同一线程(即UI线程)上.您别无选择,只能将正在执行保存的代码移至后台线程.这将释放UI线程以更新屏幕上的GIF图像.
It won''t show because you''re trying to update the animated GIF and do you save on the same thread, namely the UI thread. You have no choice but to move the code that is doing the saving to a background thread. That will free up the UI thread to update the GIF image on screen.


也许这可以帮助 [ ^ ].


这篇关于Winforms中的GIF动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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