CImageView:Append


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

Syntax

bSuccess = CImageView:Append( CImage )

where

    CImage is the CImage object to append to the image set in the CImageView object.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

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.

Examples

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

 

V = CImageView:new()

-- create a CImageView

I = CImage:new()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

bSuccess = 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 = CImageView:new()

-- create a CImageView

I = CImage:new()

-- 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 hitting Cancel

  I:Open(sPath)

-- load the image

  bSuccess = V:Append( I )

-- Create a new CImageView containing the CImage

end

 

Related Topics

Display

Insert

CImageView class

CImage class