코드에서 dropshadoweffect의 불투명도에 애니메이션 효과를 적용하려면 어떻게해야합니까? 나는 이미지와 텍스트 블록을 포함하는 UI에 동적으로 스택 패널을 생성하고있다. 이미지에 그림자 효과를 적용했습니다. 불투명도를 애니메이션으로 적용하고 싶습니다. 여기에 내가 가진 무엇 : 아마C# 코드에서 dropshadoweffect의 불투명도를 애니메이트하는 방법은 무엇입니까?
Image img = ch.ChannelLogo; //Create the image for the button
img.Height = channelStackPnl.Height * .66;
DropShadowEffect dSE = new DropShadowEffect();
dSE.Color = Colors.White;
dSE.Direction = 25;
dSE.ShadowDepth = 10;
dSE.Opacity = .40;
img.Effect = dSE;
DoubleAnimation animateOpacity = new DoubleAnimation();
animateOpacity.From = 0;
animateOpacity.To = 1;
animateOpacity.AutoReverse = true;
animateOpacity.RepeatBehavior = RepeatBehavior.Forever;
animateOpacity.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 400));
//Here's where I am stuck. How do I specifically target the opacity of the effect propery?
img.BeginAnimationimg.BeginAnimation(DropShadowEffect.OpacityProperty,animateOpacity);
포인트 이미지를하지 영향을 할 수 있습니다. – Code0987