I want the image displayed on the axis to be dragged and zoomed at the same time in MATLAB GUI.

2 ビュー (過去 30 日間)
jiawei cao
jiawei cao 2021 年 7 月 20 日
回答済み: Sarthak 2024 年 4 月 26 日
This is my first time using GUIDE. I learned that MATLAB can be used to drag and zoom by setting the Pan and Zoom tools in tool bar editor. But I want to drag and zoom with the left mouse button and the scroll wheel at the same time. There is no need to switch modes by pan and zoom.
figure;
imshow('image.jpg');
The above code, the normal display of a picture can achieve the function I described. So how can I achieve the same functionality in a GUI.

回答 (1 件)

Sarthak
Sarthak 2024 年 4 月 26 日
Hey Jiawei,
You can use the 'Image Mouse Zoom and Pan' package from File Exchange. It 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). Please download the package from:
Hope this helps!

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by