CImageView:Display

CImageView:Append


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

Syntax

bResult = CImageView:Append( CImage )

    On success, this method returns true.

    On failure, this method returns false.

Remarks

The CImageView wraps 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 fragment 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

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 = 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

  bOK = V:Append( I )

-- Create a new CImageView containing the CImage

end

 

Related Topics

CImageView , Display , Insert , CImage