Image Processing Toolbox User's Guide Previous page   Next Page
immagbox

Magnification box for scroll panel

Syntax

Description

hbox = immagbox(hparent,himage) creates a Magnification box for the image displayed in a scroll panel created by imscrollpanel. hparent is a handle to the figure or uipanel object that will contain the Magnification box. himage is a handle to the target image (the image in the scroll panel). immagbox returns hbox, which is a handle to the Magnification box uicontrol object

A Magnification box is an editable text box uicontrol that contains the current magnification of the target image. When you enter a new value in the magnification box, the magnification of the target image changes. When the magnification of the target image changes for any reason, the magnification box updates the magnification value.

API Functions

A magnification box contains a structure of function handles, called an API. You can use the functions in this API to manipulate magnification box. To retrieve this structure, use the iptgetapi function.

The API for the Magnification box includes the following function.

Field
Description
setMagnification

Sets the magnification in units of screen pixels per image pixel.

  api.setMagnification(new_mag)

where new_mag is a scalar magnification factor. Multiply new_mag by 100 to get percent magnification. For example if you call api.setMagnification(2), the magnification box will show the string '200%'.

Example

This example adds a magnification box to a scrollable image. Because the toolbox scrollable navigation is incompatible with standard MATLAB figure window navigation tools, the example suppresses the toolbar and menu bar in the figure window. The example positions the scroll panel in the figure window to allow room for the magnification box.

Change the magnification of the image in the scroll panel, using the scroll panel API function setMagnification. Notice how the magnification box updates.

See also

imscrollpanel, iptgetapi


Previous page  imlincomb immovie Next page

© 1994-2005 The MathWorks, Inc.