Overview tool for image displayed in scroll panel
imoverview function to create an Overview tool in a
new figure window. The Overview tool is a navigation aid when exploring a zoomed-in
version of the image.
Create Overview Tool in New Figure
Display an image in a figure. Suppress the standard toolbar and menubar in the figure window because these do not work with the scroll panel.
hFig = figure('Toolbar','none','Menubar','none'); hIm = imshow('foggysf1.jpg');
Create a scroll panel to contain the image. Create an overview tool in a new figure window.
hSP = imscrollpanel(hFig,hIm);
Get the scroll panel API so that you can control the view programmatically.
api = iptgetapi(hSP);
Set the magnification of the image to 200% by using the scroll panel API function
setMagnification. Notice how the detail rectangle of the overview tool shrinks because a smaller portion of the image is displayed.
api = iptgetapi(hSP); api.setMagnification(2);
htool — Handle to Overview tool
Handle to Overview tool figure, returned as a handle.
To create an Overview tool that can be embedded in an existing figure or uipanel object, use
Introduced before R2006a