Image Mouse Zoom and Pan

Instant mouse zoom & pan functionality for 2D images. Fully customizable and won't get in your way.
397 Downloads
Updated 23 Jun 2018

This function adds instant mouse zoom (mouse wheel) and pan (mouse drag) capabilities to figures,
designed for displaying 2D images in applications (e.g. created with GUIDE) that require lots of drag & zoom. It also lets you add custom callback functions to mouse button events so you can keep adding functionality.
Features:
* Minimalistic, tries not to get in your way.
* Designed to mimic behavior from common image viewers.
* Prevents the user from zooming out when the image is smaller than the Figure.
* User cannot zoom or drag the image outside of the Figure.
* Improved panning method to deal with MATLAB's lack of anti-aliasing (no deformation on high zoom level).
* Lets you add callback functions for the mouse ButtonDown / ButtonUp events so you don't lose control.
* Lots of configuration options.

Please check https://github.com/danyalejandro/imgzoompan (or the README.md text file included) for full usage instructions and examples. Github issue notifications and pull requests are welcome.

Cite As

Dany Cabrera (2024). Image Mouse Zoom and Pan (https://github.com/danyalejandro/imgzoompan), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Visual Exploration in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.2.0.0

Fixed bug that didn't let PanMouseButton and ResetMouseButton work with the left click (1).

1.1.0.0

Improved panning method to deal with MATLAB's lack of anti-aliasing
Added MaxZoomScrollCount configuration parameter.

1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.