CImageView:AttachFromList
The AttachFromList method connects an Image window to the script after it is selected from a list of all image windows. The selected Image window is returned as a new CImageView object. This method opens a window like the one shown below. Each item consists of the image window title and the number of images in the window's image set. In comparison, the Attach method selects the top-most (Image) window for processing.
NewImageView_Object = CImageView:AttachFromList() |
NewImageView_Object is a new CImageView attached from the selected image window.
On success, this method returns a new CImageView object.
On failure, this method return nil.
This method is used to attach a CImageView chosen from a list. When this method is called, the script creates a window similar to a GetItem dialog with the drop box populated with the titles of the open image windows. To attach one of the image windows to the script, select an item and click [OK]. This action creates a new CImageView, attaches it to the selected window, and returns the CImageView to the script.
Note: This method creates the CImageView, so the new constructor should not be called to create this same object before calling the AttachFromList method.
This script fragment selects an open image window from a list and then copies its currently displayed image into a new Image window. If the new window contains an image set, the image is appended to the end of the set:
V = CImageView:AttachFromList() |
-- create a list of open image windows |
Assert(V,"No Image window selected") |
-- exit the script if valid window not selected |
I = V:GetImage() |
-- get the current image from the selected window |
Vnew = CImageView:new() |
-- create a new CImageView |
Vnew:Append( I ) |
-- display the image in a new window |