CImageView:Attach


The Attach function creates a new CImageView object attached to an image window displayed on the Mira desktop. The script can then collect data from the image and change its contents. This method selects the top-most image window among all windows on the desktop. This function does not use an existing CImageView object. Also see the equivalent non-class function attach_imageview.

The related attachlist_imageview function attaches the image window selected from a list of all open image windows.

Syntax

CImageView_obj = attach_imageview()

bullet.gif    On success, a new CImageView class object is returned.

bullet.gif    On failure, nil is returned. This usually means no image window is shown on the Mira desktop.

Example

Assume that several image windows are displayed on the Mira desktop, and the window of interest is top-most of all image windows. The following script attaches that window to the script:

V = attach_imageview()

-- attach the top-most image window

if V == nil then Exit() end

-- if not successful, exit the script

Printf("Attached imageview %s\n")

-- print the title of the attached window

Related Topics

CImageView class, new, attach_imageview, attachlist_imageview


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.