CImageView:GetImage


The GetImage method returns a new CImage object for the image currently displayed in the CImageView (i.e., in the image view window).

Syntax

CImage = CImageView:GetImage()

CImage = CImageView:GetImage( nIndex )

where

    nIndex is the image to select, in the range 1 to Count. If not passed, the current image is selected.

    CImage is the CImage object at the specified nIndex

    On success, this method returns a new CImage object. On failure, nil is returned.

 

This method automatically creates a new CImage object. You do not need to use CImage:new to create an object.

Example

Assume that an image is displayed in a CImageView named V. The following script crops the current displayed image at the limits of the image cursor:

I = V:GetImage()

-- attach the displayed image to the CImage

R = V:GetCursorRect()

-- get the cursor extent as a CRect

I:Crop( R )

--crop the image to the image cursor

Related Topics

GetImagePtr

CImageView class

CImage class