IDLgrWindow::ZoomIn

The IDLgrWindow::ZoomIn procedure method does the following:

Note: This method does not change the window contents automatically. The application is responsible for updating the window content based on the new zoom value.

Syntax

Obj->[IDLgrWindow::]ZoomIn

Arguments

None

Keywords

None

Example

While you are free to use the value of the CURRENT_ZOOM, ZOOM_BASE, and ZOOM_NSTEP properties to modify the contents of the IDLgrWindow in any way you see fit, one choice is to modify the value of the VIEWPLANE_RECT property of the IDLgrView object that contains your graphics.

First, we create an IDLgrWindow containing a simple plot:

mywindow = OBJ_NEW('IDLgrWindow', RETAIN=2)
myview = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[-10,-10,20,20])
mymodel = OBJ_NEW('IDLgrModel')

x = (FINDGEN(21) / 10.0 - 1.0) * 10.0
y = RANDOMU(seed, 21) * 10.0 - 5.0
myplot1 = OBJ_NEW('IDLgrPlot', x, y)

myview->Add, mymodel
mymodel->Add, myplot1
mywindow->Draw, myview

Next, we use the ZoomIn method to change the current zoom, and then change the VIEWPLANE_RECT property by the current zoom amount:

mywindow->ZoomIn
mywindow->GetProperty, CURRENT_ZOOM=cz
myview->GetProperty, VIEWPLANE_RECT=vr
myview->SetProperty, VIEWPLANE_RECT=vr*cz
mywindow->Draw, myview

(Another option would be to use the IDLgrModel::Scale method to modify the scale factors used by the model object.)

When you have finished with the example, destroy the IDLgrWindow and IDLgrView objects:

OBJ_DESTROY, mywindow
OBJ_DESTROY, myview

Version History

6.1

Introduced