Image Processing Toolbox User's Guide |
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.
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.
hFig = figure(`Toolbar','none',... 'Menubar','none'); hIm = imshow('pears.png'); hSP = imscrollpanel(hFig,hIm); set(hSP,'Units','normalized',... 'Position',[0 .1 1 .9]) hMagBox = immagbox(hFig,hIm); pos = get(hMagBox,'Position'); set(hMagBox,'Position',[0 0 pos(3) pos(4)])
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
imlincomb | immovie |
© 1994-2005 The MathWorks, Inc.