CImage:Display


The Display method displays the CImage in a new CImageView. The CImageView window is created by this method. There is a parallel method in the CImageView class.

Syntax

CImageView = CImage:Display()

where

    CImageView is a new CImageView object attached to the window displaying the CImage.

    On success, this method returns a CImageView object.

    On failure, this method returns nil.

  

This method creates a new CImageView window and displays in it a copy of the CImage. The image in the CImage object is not the same image as in the CImageView, although they initially have identical properties; rather the CImage and the displayed image point to two different objects in memory.

After this methods returns a reference to the new CImageView, CImageView class methods can be used to manipulate the displayed image.

Example

The following script displays a CImage in a CImageView window:

V = CImageView:new()

-- not needed if using CImage:Display()

I = CImage:new()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

V = I:Display()

-- displays the image and returns the new CImageView

Related Topics

CImage class

CImageView class