开发者

Animation for images wpf

I want to move the images one by one like slides. i am using the following code to move one image. 开发者_Go百科How to apply this animation to all the images in the image folder.

Code:

 <Image Name="img" Width="50" Height="25"  Grid.Row="3" HorizontalAlignment="Left" Source="btn_audio_stop.jpg">
        <Image.Triggers>
            <EventTrigger RoutedEvent="Image.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Trans" Storyboard.TargetProperty="Y" Duration="0:0:25">
                                <LinearDoubleKeyFrame Value="350" KeyTime="0:0:25" />
                                <!--<LinearDoubleKeyFrame Value="50" KeyTime="0:0:5" />
                                <LinearDoubleKeyFrame Value="200" KeyTime="0:0:3" />-->
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
        </Image.Triggers>
        <Image.RenderTransform>
            <TranslateTransform x:Name="Trans" X="0" Y="0" />
        </Image.RenderTransform>
    </Image>


See following articles

http://www.c-sharpcorner.com/UploadFile/prvn_131971/ImageSlideshowWPF11162008224421PM/ImageSlideshowWPF.aspx

http://www.c-sharpcorner.com/UploadFile/dpatra/569/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜