Main Content

imoverviewpanel

Overview tool panel for image displayed in scroll panel

Description

Use the imoverviewpanel function to add an Overview tool to the same figure as an image contained in a scroll panel. The Overview tool is a navigation aid when exploring a zoomed-in version of the image.

The Overview tool displays the target image in its entirety, scaled to fit. The tool overlays a rectangle, called the detail rectangle, over the scaled version of the image. The detail rectangle shows the portion of the target image that is currently visible in the scroll panel. To view portions of the image that are not currently visible in the scroll panel, move the detail rectangle in the Overview tool.

hTool = imoverviewpanel(hParent,hImage) creates an Overview tool for image hImage. The image must be displayed in a scroll panel. The Overview tool hTool is added to the parent figure or panel hParent.

example

Examples

collapse all

Display an image in a figure. The example suppresses the standard toolbar and menubar in the figure window because these do not work with the scroll panel.

hFig = figure(Toolbar="none",Menubar="none",Name="Foggy");
hIm = imshow("foggysf1.jpg");

Create a scroll panel to contain the image. Set the size and position of the scroll panel so that the image occupies the top half of the figure window.

hSP = imscrollpanel(hFig,hIm);
set(hSP,Units="normalized",Position=[0 .5 1 .5])

Figure Foggy contains an axes object and another object of type uipanel. The hidden axes object contains an object of type image.

Add an overview tool to the figure. Set the size and position of the overview tool to occupy the bottom half of the figure window.

To explore details of the displayed image, try dragging the detail rectangle over the overview tool.

hOvPanel = imoverviewpanel(hFig,hIm);
set(hOvPanel,Units="Normalized",Position=[0 0 1 .5])

Figure Foggy contains 2 axes objects and other objects of type uipanel. Hidden axes object 1 contains an object of type image. Hidden axes object 2 contains 8 objects of type line, patch, image.

Input Arguments

collapse all

Parent of the Overview tool, specified as a Figure or Panel object.

Image, specified as an Image object. The image must be displayed in a scroll panel created by imscrollpanel.

Output Arguments

collapse all

Overview tool, returned as a Panel object.

Tips

  • To create an Overview tool in a separate figure window, use the imoverview function. When created using imoverview, the Overview tool includes zoom-in and zoom-out buttons.

Version History

Introduced before R2006a