Silverlight SlideShow

While scaning my Google Reader, I noticed that Mike Swanson had posted something about a Silverlight slideshow app. It caught my interest because a while back I started to create one in Silverlight 1.1 (now 2.0, it’s the one that lets your write C# instead of, yuck, JavaScript). I got far enough to see some results but quit due to the lack of tooling at that time in Expression Blend. Anyway, Mike was talking about something that Vertigo created on Silverlight 1.0. You can get the code from the SlideShow project at codeplex. I grabbed the code. I made a simple slideshow [you will need Silverlight 1.0 installed.] This is pretty cool. Basically, it runs off of an xml file that configures albums, image titles, image locations and so on. You create this file to tell the stuff from Vertigo how to do what it does.

So, having just gotten back from a backpacking trip to Europe, I’ve got tons of photos – a slideshow would be nice. Well, if you are going to make a serious slideshow with this stuff, you will quickly find yourself opening lots of photos, and editing xml, resizing images for the web, making thumbnails over and over. Better get comfy with IrfanView, and a good xml editor. Rather than invest the time to build a single grand slideshow, I started down the path of making a tool to do it. It would have to resize images for me (a thumbnail and a web-sized image would be nice), it’d be cool if it could grab those little pieces of info that the camera puts on the photos (metadata – like ‘DateTaken’) as well as any other stuff I have added to the images with programs like Image Metadata Editors, and lastly it’d need to generate that xml file needed by the slideshow code. Here’s a start on that tool. [Make sure to grab .NET 3.5 if you don’t have it already.] It currently will grab the metadata, resize pics, and it lets you edit what gets put in the slideshow.


To use the tool, you need to have your pictures arranged in albums, i.e. I already had my pictures sorted by city, so the albums are cities. Something like this:


Then you will want to set the output directory, generate the images, and finally the ‘data.xml’ file. You end up with something like:


Then you just need to copy that up to your webhost, along with the stuff from Vertigo, and your slideshow should be ready. I have worked with ‘album directories’ containing up to roughly 1000 images – you do notice some performance impacts as you get tons of images. I had to go ahead and make the tool pre-generate thumbs after you select the album directory (so I could show the picture thumbs in the UI) because using the original pics caused my machine to lock up – paging like crazy due to lack of sufficient memory. (I tried UI Virtualization to no avail, anyway…you would have to generate the thumbs later regardless so its not wasted effort. I cache them in a ‘temp’ directory next to the exe.) I have noticed that certain things in the UI of the tool, such as changing the album thumbnail using the ‘Album Thumbnail’ button seem to work much better in Vista. If there is interest, I can make the code available.

Off to make some slideshows…

About ben_hoffman

I’m Ben Hoffman, this site is a collection of thoughts, links and notes about whats going on for me. During daylight hours I can be found at New Eagle, where I work as Product Platform Architect / Software Team Manager. This is my personal website and reflects my views and opinions only. Any comments made on this website, by myself or by third parties, do not necessarily reflect views or opinions of my employer.
This entry was posted in Software Development. Bookmark the permalink.

2 Responses to Silverlight SlideShow

  1. Richard Sieber says:

    Hi Ben
    I read your article in your blog.
    I tried to run your application. Created two folder in and out. First with two jpeg photos. After running generate Images and Generate Data I received only two lines of
    code in an XML file. I’ve Framework version 3.5 installed.
    Do you have any idea whats going wrong ?

    Thank you in advance


  2. Eduardo says:

    Hello ! I Would know how i could edit Data.xml from C#, you are doing it this into your source code, I guest .
    Im trying fill the SlideShow with image paths for obtains from my Data Base.

    I really would appreciate your help.

Leave a Reply

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