How to enable zooming only when the scroll is rotating?
Mostrar comentarios más antiguos
Hello all.
I have a script that tries to enable the zoom in/out when the mouse wheel is scrolled only. In the following example, the zoom is open when I scroll and remains for 1.0 sec before turning off again.
I am wondering if there is a way to construct MATLAB to allow the zoom only if the wheel is scrolling, and disables the zoom once I stop the scroll, instead of doing it for 1.0 second each.
rgbImage = imread("peppers.png");
imshow(rgbImage)
hFig = gcf;
set(hFig, 'WindowScrollWheelFcn', @scrollCb)
function scrollCb(varargin)
% This function enables zooming in/out for one second before disabeling it again
zoom on;
pause(1.0);
zoom off;
end
Please advise.
Thanks a lot
1 comentario
Ahmad Gad
el 20 de Sept. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!