CImageView:Attach


The Attach method attaches the top most window (an Image window) to the script and creates a new CImageView object for it.

Syntax

NewImageView_Object = CImageView:Attach()

where

    NewImageView_Object is a new CImageView object. On failure, nil is returned.

  

Use Attach to run the script on the top-most Image window. To do this, bring the target window to the top of the stack and run the script using the [!] button on the main toolbar.

Note: This method creates a new CImageView object so the new constructor should not be called for this object.

Example

Suppose the script works with an image set displayed in the top-most window. The following script attaches the top-most window (an Image window) to the script and selects the 2nd image from the set:

V = CImageView:Attach()

-- attach the existing Image window

I = V:GetImage( 2 )

-- get a pointer to the 2nd image

Related Topics

AttachFromList

GetViewPtr

CPlotView:Attach()

CImageView class