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() |
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:
|
-- create a list of open image windows |
|
-- exit the script if valid window not selected |
|
-- get the current image from the selected window |
|
-- create a new CImageView |
|
-- display the image in a new window |