Main Content

imoverview

Overview tool for image displayed in scroll panel

Description

Use the 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.

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.

Overview tool with blue detail rectangle over a portion of the image.

imoverview(hImage) creates an Overview tool associated with the image hImage.

example

hTool = imoverview(hImage) returns the figure hTool containing the Overview tool.

Examples

collapse all

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",Name="Foggy");
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);

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

imoverview(hIm)

Figure Overview (Foggy) contains an axes object and other objects of type uipanel, uitoolbar, uimenu. The hidden axes object contains 8 objects of type line, patch, image.

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);

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

Figure Overview (Foggy) contains an axes object and other objects of type uipanel, uitoolbar, uimenu. The hidden axes object contains 8 objects of type line, patch, image.

Input Arguments

collapse all

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

Output Arguments

collapse all

Overview tool figure, returned as a Figure object.

Tips

  • To create an Overview tool that can be embedded in an existing figure or panel, use imoverviewpanel.

Version History

Introduced before R2006a