1
我有三個圖像,其中兩個圖象的動畫作爲遵循和第三圖像應該閃爍:WPF動畫和變化圖像的不透明度在序列
<Window.Resources>
<Storyboard x:Key="AnimateTarget" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames BeginTime="0:0:0" Duration="0:00:03" Storyboard.TargetName="img1" Storyboard.TargetProperty="Y">
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="200" />
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0:0:2" Duration="0:00:03" Storyboard.TargetName="img2" Storyboard.TargetProperty="x">
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="200" />
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimation BeginTime="0:0:4" Duration="0:0:0.5" Storyboard.TargetProperty="(Image.Opacity)" Storyboard.TargetName="img3" From="1.0" To="0.0" RepeatBehavior="Forever" AutoReverse="True" />
</Storyboard>
</Window.Resources>
前兩個圖像被動畫細但第三圖像沒有按」牛逼閃爍,什麼也不做,只是呆在那裏,你可以看到我用下面的代碼閃爍第三圖像:
<DoubleAnimation BeginTime="0:0:4" Duration="0:0:0.5" Storyboard.TargetProperty="(Image.Opacity)" Storyboard.TargetName="img3" From="1.0" To="0.0" RepeatBehavior="Forever" AutoReverse="True" />
而且這是第三圖像的代碼:
<Image Height="65" Name="image1" Stretch="Fill" Width="67" Source="/PicTakeWPF;component/Images/422505_110594629067212_100003500265268_37406_1212153553_n.jpg">
<Image.RenderTransform>
<TranslateTransform x:Name="img3"></TranslateTransform>
</Image.RenderTransform>
</Image>
,如果有人可以幫助我在此感謝 我將不勝感激,
謝謝,您的解決方案完美地工作。 – sam