What is Deep Zoom for WPF?
One of the most "magical" features of Silverlight is
Deep Zoom. Through the use of clever partitioning of images, Deep Zoom allows users to pan and zoom smoothly through immense (and potentially infinite) images with excellent performance. Since the release of Deep Zoom with Silverlight 2, it has been one
of the most requested missing features from WPF.
Well, your requests have been answered! This project is an implementation of
Deep Zoom for WPF, complete with
Deep Zoom Composer and
Zoom.it support, multi-touch support and more.
To use the control, all you have to do is add a reference to DeepZoom.dll and add it to your XAML file as if it were a normal image:
Title="MainWindow" Height="800" Width="1280">
<dz:MultiScaleImage Source="http://static.seadragon.com/content/misc/color-flower.dzi" />
Limitations and known issues
The current implementation of the control is a simplified version of the Silverlight MultiScaleImage, supporting only its most essential features. Its limitations ans known issues are:
- The control only supports Deep Zoom images (including sparse images), with
no support for Deep Zoom Collections yet.
- Unsupported members from Silverlight:
- The control only supports panning and zooming with mouse dragging/wheel and multi-touch, with
no additional buttons for navigation (though they can be easily added).
- The maximum number of tiles (total) is int.MaxValue (~2.1 billion). This is due to the use of IList/ItemsContainerGenerator for virtualization. Therefore, the maximum zoom level will be ~24 (depending on your image's aspect ratio).
- The pan and zoom performance gets worse after level ~21. If you have an idea on how to fix this please let me know!
Tell me more!
For more information on the Deep Zoom control and how it's built, see the CodeProject article that explains its workings in details at http://www.codeproject.com/KB/WPF/DeepZoom.aspx .
This project uses code from the following libraries:
Special thanks to
IntuiLab, my employer when this project was born, for allowing me to publish this project and article as open source!
Roberto Sonnino - 2010