闪烁图像的动画 [英] Blinking animation for an image

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

问题描述

大家好,

我正在使用以下代码进行图像动画处理(闪烁),但是问题是我无法控制其闪烁时间,我希望这样一种功能可以启动它,而另一个功能可以停止它.

如果有人有其他想法或代码,请与我分享.


Hi All,

I am using following code for an image animation(blinking).But problem is I am not able to control its blinking time.I want it such a way that one funcion will start it and another function will stop it.

if anyone has another idea or code.please share with me.


Storyboard sb = new Storyboard();
     DoubleAnimation oa = new DoubleAnimation();
     oa.Duration = new Duration(TimeSpan.FromSeconds(0.5));
     oa.From = 1;
     oa.To = 0.2;
     Storyboard.SetTarget(oa, img);
     Storyboard.SetTargetProperty(oa, new PropertyPath(Image.OpacityProperty));
     oa.AutoReverse = true;
     oa.RepeatBehavior = RepeatBehavior.Forever;
     sb.Children.Add(oa);
     sb.Begin();




谢谢.




Thanks.

推荐答案

您可以使用ad-rotator或Flash软件对图像进行动画处理并将其添加到您的代码中
you can use ad-rotator or use flash software to animate image and ad it to your code


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

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