Monday, March 31, 2008

Dissecting Hard Rock Memorabilia and Silverlight Deep Zoom - Part 4

Update Oct 14, 2008: Removed the example from this post to reduce load time of this page. Please use the example from this post, DeepZoom sample ported to Silverlight 2 Beta 2, to try the functionality.

Click on the Randomize button to randomly arrange the images.

Click on the Full Screen button to get into full screen mode. I am not sure if there is bug in Silverlight or I am doing something wrong but it seems like the MultiScaleImage height and width is not reset after it gets out of the full screen mode! Also, the keyboard seems to be disabled in full screen mode (except for the ESC key)!

Click on the Set Source button to set the source for the MultiScaleImage control to the one specified in the text box to the left of the button. This should be a fully qualified URI and should point to a valid items.bin file (http://.../items.bin). I could not get this to work across domains even after placing a crossdomain.xml file in the root folder of my alternate web host but maybe I was doing something wrong. It seems to work if the file is in the same host but for some reason it is not arranging the images. You can try this url and see what I mean -

What I learned from this exercise so far...
  • How to use some of the Siverlight 2 controls, position them on the screen so that they scale, and apply borders to them!
  • How to enable full screen mode. The msdn help section refers to some Javascript code to achieve this but I wanted to do it in managed code. Finally figured it out...
    buttonFullScreen.Click += (sender, e) => Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;

    Application.Current.Host.Content.FullScreenChanged (sender, e) => // Will be called when the control renders in full screen;
    Application.Current.Host.Content.Resized (sender, e) => // Will be called when the control gets out of full screen;
  • How to host this puppy! Initially I tried but then realized that I couldn't upload the deep zoom images up there. So I used my host to upload the images but then realized that the control located at couldn't access the images from my host - I even played around with the crossdomain.xml with no success. I then decided to host everything on my host ( since they did support the .xap mime type without any additional tweaking


kanc said...

Hi Wilfred!

Dont know if you solved that problem you had in part4 of your "Dissecting Hard Rock Memorabilia and Silverlight Deep Zoom" with arranging images after you pointed to a diferent source (.bin file)?

I have the same problem. msi.subimages.count is allways the same number (number of images that were first loaded) so i think the problem is with subimages.

So if you have solved this your help would be much appreciated.

thanks in advance

-matija kancijan

Wilfred Pinto said...


This is definitely a bug in SL 2 Beta 1. There is a workaround for non collection images but I haven't been able to get it to work with collection images.


kanc said...


So, there is a way to combine multiple non collection images in one msi if i understand correctly? i

could not find nothing that describes how to do that...

combining different non collection images would be great, can you tell me how to do that?

or did you have something else in mind with "There is a workaround for non collection images"?

Thank you for your patience ;)

-matija kancijan