Saturday, 19 July 2008

DeepZoom Composer Tag "Cloud" Mk II



Adding tags within the latest Deep Zoom Composer is a neat way to navigate DeepZoom 'Collections'.

But if we are going to introduce a new file (Metadata.xml) why not really leverage it?

To that end, I've added a Description element to the Metadata.xml file and typed my own descriptions for each image in my collection. There are two new TextBlocks in the Silverlight control to show the data, and whenever your mouse is over an image, its Tag and Description are displayed. Try it out (beta 2) (or RC0).



The code to match extract the description is a simple extension of the Tag sample.


Then we need to add some code to the MouseMove event to see what SubImage we're over:


which uses SubImageHitTest() from ProjectSilverlight to determine the index of the image to show Tag/Description for.



Finally, you'll notice the 'browse by tag' is now a very basic "cloud". To accomplish that I replaced the ListBox with WrapPanel for Silverlight 2.0 off CodeProject, replaced the items with Buttons and added this ControlTemplate:


The updated files are Page.xaml.cs and Page.xaml.

6 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Craig.

    After editing the specified files and adding the Silverlight toolkit Microsoft.Windows.Controls references I still get the following errors as unfound references

    ContentPresenter
    and WrapPanel:WrapPanel

    could you offer any help? do you still have a project source zip?

    ReplyDelete
  3. Unfortunately I really can't find the source I was using for that stuff. The WrapPanel was off CodeProject.com (mentioned in the post); not sure what the ContentPresenter problem is.

    I don't think there's a lot of code involved; you could always use Reflector to decompile it.

    If I do find the stuff on a backup somewhere I'll post the whole solution; not sure why I didn't upload the whole thing last year...

    ReplyDelete
  4. Thanks Craig that would be much appreciated.

    We are having alot of trouble applying these changes. Oh and I did get the proper WrapPanel. That was a small oversite.. but the project still doesn't build.

    ReplyDelete
  5. Hi Craig

    I am having the same issues as Mark, so wondered if you had found your previous code. You are the only person i can find that has got multiple tags working. So it would be great to get it working as single tages just arent enough for my project.

    thanks

    Tim

    ReplyDelete
  6. Tim, I just responded to Mark on another post. The source is downloadable from http://www.deepzoompublisher.com/TagUpdater/DeepZoomTagCloud_v0.5.zip. I make no guarantees about the quality of the code tho' - I haven't looked at it in a while.

    ReplyDelete

Note: only a member of this blog may post a comment.