views:

23

answers:

1

Hi All,

I want to move the images one by one like slides. i am using the following code to move one image. 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>
+1  A: 

See following articles

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

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

Ragunathan
Is it possible to achieve this by using animation and storyboard?
Geetha
Storyboard will give the effects on various events or states. But moving images one by one should be done using coding. (May be on button click or using timer to move prev/next slide)
Ragunathan