setMouseShape()

Description

Sets the shape of the mouse (cursor) hovering over the image container.

Syntax

ImageViewerObject.setMouseShape(iValue);

Parameters

<bool> iValue: the value to set

Return value

bool

Remarks

When it is set to true and the method returns true, the cursor is set as a hand.
If the width or height of the image is bigger than the Dynamsoft image viewer, scroll bars will appear and you can drag the image to adjust the position.

When it is set to false and the method returns true, the cursor is set as a cross.
You can then select an rectangular area on Dynamsoft image viewer directly. After that, you can get the coordinates of the selected area by .ui.getImageSelectedAreaInfo() and do things like crop.

Please note that no matter whether it’s set to true or false, the cursor is an arrow as long as the cursor is outside of image container.

When an error occurs, check getErrorCode() or getErrorString() for error information.

Example

             var imageviewer = DCSObject.getImageViewer("ImageViewerContainer");  // Get a specified image viewer
             imageviewer.ui.setMouseShape(true);
             imageviewer.ui.getMouseShape();
       

See also

.ui.getMouseShape()
.ui.setImageViewMode()
.ui.getImageSelectedAreaInfo()