Create an Image Slideshow in WPF

You may also like...

9 Responses

  1. Wilhelmina says:

    Having read this I believed it was very informative.

    I appreciate you spending some time and energy to put this information together.
    I once again find myself spending a significant amount of time both reading
    and leaving comments. But so what, it was still worthwhile!

  2. Kerri says:

    These are in fact great ideas in regarding blogging. You have touched some pleasant things here. Any way keep up wrinting.

  3. Sherlyn says:

    Admiring the commitment you put into your website and in depth information you provide.
    It’s awesome to come across a blog every once
    in a while that isn’t the same outdated rehashed material.
    Great read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  4. Dorcas says:

    If you are going for finest contents like me, only visit this web page all the time for the reason that it
    provides quality contents, thanks

  5. Greg says:

    This is really nice. It provided me with a good starting point. A couple pointers, though:

    – Delete the “FadeOut” animation. It can cause issues in the middle of the animation when both images are around 0.5 opacity. I assume you tried to mitigate this somewhat by having your animations run on different timing, but that causes another problem: the timing alternates. To see this, increase one of the animation times to a couple seconds. You’ll see that one fade is quick and one is slow, and they alternate.
    – Play with the Panel.ZIndex property. Since you only have a “FadeIn” animation, you’ll want to bring that image to the foreground so that you can see it. To do this, push the visible image control to the back and bring the new image control to the front. Here’s a replacement for some of the code in _PlaySlideShow()

    var imgFadeOut = _imageControls[oldCtrlIndex];
    Panel.SetZIndex(imgFadeOut, 0);
    var imgFadeIn = _imageControls[_currentCtrlIndex];
    Panel.SetZIndex(imgFadeIn, 1);
    imgFadeIn.Opacity = 0;
    var newSource = _images[_currentSourceIndex];
    imgFadeIn.Source = newSource;

    This will give a nice consistent fade for every transition.

    • Caleb says:

      Thanks so much, Greg! My slideshow for a Digital Management Board at work would occasionally show NO image at all for the duration of an image. I implemented your changes and my slideshow shows one picture right after the other with, an honestly cleaner animation. The animation style is personal preference but yours fixed my slideshow’s functionality. Good addition to a great tutorial.

  6. jb says:

    just the source code. ofcourse thank u 4 that

  7. john says:

    Unfortunately, this trivial demo only works on a handful of images. On few dozen images it throws OutOfMemoryException in PresentationCore.dll. I see posts on the Web that you cannot use ImageSource for dynamic image display. I an still looking a real slideshow example.

  8. Christos says:

    How can you add a hyperlink to each picture?

Leave a Reply to Kerri Cancel reply

Your email address will not be published. Required fields are marked *

five × 4 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">