Published Saturday, March 08, 2008 9:51 AM by mtaulty

Silverlight 2 - Update to MultiScaleImage Post

Quick update to this post - firstly I changed my OnKeyDown function;

 

    void OnKeyDown(object sender, KeyEventArgs e)
    {
      double centreX = msi.ViewportOrigin.X + (msi.ViewportWidth / 2);

      double viewportHeight = msi.ViewportWidth / msi.AspectRatio;

      double centreY = msi.ViewportOrigin.Y + (viewportHeight / 2);

      double xInc = 0.05 * msi.ViewportWidth;
      double yInc = 0.05 * viewportHeight;

      switch (e.Key)
      {
        case Key.I:
          msi.ZoomAboutLogicalPoint(1.1, centreX, centreY);
          break;  
        case Key.O:
          msi.ZoomAboutLogicalPoint(0.9, centreX, centreY);
          break;
        case Key.Right:
          msi.ViewportOrigin = new Point(msi.ViewportOrigin.X + xInc,
            msi.ViewportOrigin.Y);
          break;
        case Key.Left:
          msi.ViewportOrigin = new Point(msi.ViewportOrigin.X - xInc,
            msi.ViewportOrigin.Y);
          break;
        case Key.Up:
          msi.ViewportOrigin = new Point(msi.ViewportOrigin.X,
            msi.ViewportOrigin.Y - yInc);
          break;
        case Key.Down:
          msi.ViewportOrigin = new Point(msi.ViewportOrigin.X,
            msi.ViewportOrigin.Y + yInc);
          break;
        default:
          break;
      }
    }
  }

 

and secondly I learned a little bit more ( I think ) about using the Deep Zoom Composer. I revisited my project and arrange these 9 images;

image

and if you notice in the middle image there's a magnifying glass showing where I've dropped 9 more images...so I zoom in...

image

and right in the middle of that image I have 9 more images ( they are in the eye of one of the fish :-) ) and if you notice in the middle there's a magnifying glass and so if I zoom in further;

image

then in the middle of that image there are 9 more images. I stopped at that point, it was making my head hurt :-) but it makes for a nicer zoom in and zoom out demo than I originally had with just a bunch of images and no "images inside images".


Filed Under:

# Silverlight 2 Resource @ Wednesday, March 26, 2008 8:52 AM

It has been three weeks since we annouced Silverlight 2 at MIX08. Many of you are excited to getting

Canadian User Experience

# Finance Innovation Contest Winners | DavidCrow.ca @ Wednesday, April 02, 2008 2:05 PM

PingBack from http://davidcrow.ca/article/6700/finance-innovation-contest-winners

Finance Innovation Contest Winners | DavidCrow.ca