CImageView:SetCursorExtent


The SetCursorExtent method sets the extent of the image cursor in the CImageView. This differs from SetCursorRect in the argument list.

Syntax

bSuccess = CImageView:SetCursorExtent()

bSuccess = CImageView:SetCursorExtent( CRect )

bSuccess = CImageView:SetCursorExtent( xmin, xmax, ymin, ymax )

where

     

    xmin,xmax, ymin, ymax specify the cursor bounds, in pixel coordinates.

    CRect is a CRect object that describes the rectangle to use.

    If no argument is specified, the entire image size is used.

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

Example

Assume that a CImageView object named V exists and refers to an image window. The following script sets the image cursor to an x-range of 50:150 and a y-range of 100:300. Notice that both values returned by R:Size() can be printed since it is the last parameter in the Printf argument list:

 

V:SetCursorExtent(50,150,100,300)

-- set the image cursor

R = V:GetCursorRect()

-- fetch the image cursor rectangle

Printf("W=%lg, H=%lg", R:Size())

-- Result: W=100, H=200

Related Topics

GetCursorRect

SetCursorRect

SetCursorWidth

SetCursorHeight

CImageView class