tags:

views:

214

answers:

2

WPF: What is the best way to implement Zoom In and Zoom Out option for an Image inside ScrollViewer in WPF at runtime and also other alternative methods for the same

Please provide sample code and suggest links where I can find sample code and more info about various ways to Zoom the image.

Regards, Anwar

A: 

There are many pan and zoom viewers for wpf. A few that I have found helpful to learn and to borrow code are:

WPF Extensions http://wpfextensions.codeplex.com/

Pan and Zoom (DeepZoom style) in WPF http://blogs.windowsclient.net/joeyw/archive/2008/08/05/pan-and-zoom-deepzoom-style-in-wpf.aspx

Queso
A: 

You could use a ScaleTransform to zoom in and out, and a TranslateTransform for panning

Thomas Levesque