The ultimate zooming and panning control for WPF.

ZoomPanel is a custom control that provides the ultimate animated zooming and panning capabilities to any WPF application.
At first, zooming and panning seems like a simple task in WPF because any element can be scaled with ScaleTransform. But when you want to integrate scrollbars, animation, mouse control, zoom to target, mini map and other features, this task quickly becomes very complicated.
Do not spend many hours developing zooming features on your own. Instead, use ZoomPanel with its ultimate zooming features and spend your precious time on other tasks.
.Net 5 and newer notice:
ZoomPanel library do not provide a special build for .Net 5 or newer framework. But the library can be still used in .Net 5 and newer frameworks because newer frameworks support using assemblies build with older framework version. But to distribute a .Net 5 or newer application you will not be able to use standard licensing with license.licx files. You will need to use licensing by using "Application license key".
The main controls of the Ab2d.Controls.ZoomPanel library are:
Note: the library is available only for WPF applications - not for Silverlight.
Sample usage
WPF's vector based graphical engine is a perfect choice to display complex 2D diagrams, schemas, complex graphs and other graphical elements. It is often necessary for the user of the application to see the whole image and that the user can also zoom in to see the details. The WPF already provides some basic scaling and translating mechanism. ZoomPanel adds additional features that makes any possible zooming and panning task very easy and delivers great results.
The following code is all that is needed to use the main controls in the ZoomPanel library and produces similar results as in the image above:
|
|
First we need to add reference to our assembly and add a namespace declaration to the root element. The ZoomPanel control does most of the "magic". Based on its ZoomMode it enables zooming in and out, panning, zooming to selected rectangle of the content of ZoomPanel. The ZoomController control is just a predefined ToggleButtons panel that enables user of the application to switch between different ZoomMode on ZoomPanel.
The following ZoomModes are available:
In all zoom modes except None zooming in and out can be also done with mouse wheel (if not disabled by IsMouseWheelZoomEnabled property).
The ZoomPanel can be fully customized by using many of its public methods. Also a custom control can be derived from it and some core methods can be overriden to provide custom behavior.
It is also possible to create your own ZoomController - the sample application that comes with the package shows two different ways to do this.
The ZoomPanelNavigator can be used to select the zoom factor by slider and to move the shown area around with buttons. The control can be simply customized with setting your own colors, selecting orientation or showing just part of the control (only the buttons or only the slider).
The sample also places a ZoomPanelMiniMap to the bottom right corder. The control shows which part of the content is currently visible. It can be also used to move the shown area around with dragging the rectangle in the MiniMap. With mouse wheel it is also possible to zoom in and out the content of the ZoomPanel.
More information on properties and methods can be found in the help file that is included in the package.
ZoomPanel is great when it is showing vector based content. It is very useful for viewing images created from svg or metafiles. The following sample is using SvgViewbox from Ab2d.ReaderSvg library to read myVectorDiagram.svg file. With ZoomPanel it is possible to zoom in the image to see additional details.
|
|
The following sample is showing how to read a metafile with WmfViewbox control from Ab2d.ReaderWmf library.
|
|
The library comes with many samples that show the ZoomPanel and other controls in action. The following are two videos and screenshots from the samples (click on image to see video or a bigger screenshot):







Related Blog posts
To see the development history of Ab2d.ReaderSvg and ViewerSvg, check out the related blog posts.
New in version 6.0