Marklar
Marklar

Reputation: 1056

Silverlight, DeepZoom zooming animation

When I set the ViewportWidth of a Deepzoom image in Silverlight the zoom level changes very quickly. Is there a way I can set the time this zooming animation should take?

Thanks

Upvotes: 1

Views: 437

Answers (3)

Craig H
Craig H

Reputation: 175

Although you cannot set the timing directly, each "Spring" takes exactly 1.5 seconds. So, if you wanted to, you could leave springs on, and then calculate the difference between the current viewportwidth, the viewport width you want to go to, and try and massage the timing this way. That being said, it may look awkward, so you'd have to test it first.

Upvotes: 0

AnthonyWJones
AnthonyWJones

Reputation: 189457

The only way to do that would be to set UseSprings to false and animate the value of ViewportWidth yourself. This will also force you to animate the the ViewportOrigin as well when performing panning operations if you want to maintain the "spring" animation of panning.

You would need to test the performance of this. It could well be that MultiscaleImage may optimise its own animations differently than when these properties are being animated externally.

Upvotes: 1

Michael S. Scherotter
Michael S. Scherotter

Reputation: 10785

Try using the MultiScaleImage.UseSprings = true and the ZoomAboutLogicalPoint() method.

Upvotes: 0

Related Questions