CImageView:Append


The Append method appends a CImage to the end of the image set of the CImageView.

Syntax

bResult = CImageView:Append( CImage )

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

The CImageView refers to a Mira image display window. The Image window uses an image set to display multiple images. This method appends the image list with the image wrapped by the CImage object. If the CImageView has been instantiated using new but no images have yet been displayed in it, then Append works like Display.

Example

The following script creates a CImageView and appends an image to it:

V = new_imageview()

-- create a CImageView

I = new_image()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

bOK = V:Append( I )

-- Creates a CImageView to display the CImage

The following fragment uses a loop to interactively append images until you click[Cancel] on the Open dialog. Inside the loop, the first use of Append creates the CImageView and displays the image. Each subsequent cycle of the loop appends an image to the same CImageView:

V = new_imageview()

-- create a CImageView

I = new_image()

-- create a CImage

while true do

 

  local sPath, bOk = GetFileName()

-- use the Open dialog to get a filename

  if not bOk then Exit() end

-- exit the loop after canceling the Open dialog

  I:Open(sPath)

-- load the image

  bOK = V:Append( I )

-- Create a new CImageView containing the CImage

end

 

Related Topics

CImageView , Display , Insert , CImage class


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