getZoom()

Description

Gets zoom factor for the current image, only valid when fit-to-window type is set to EnumFitToWindowType.None.

Syntax

ImageViewerObject.ui.getZoom();

Parameters

None

Return value

<float>

Remarks

The zoom value is expressed as a percentage. The valid range is from 2 to 6500 percent (Value: 0.02 ~ 65.0); the default value is 100 percent (Value: 1.0). A zoom value can be specified before or after an image is displayed. When the zoom value is changed, the displayed image will refresh automatically.

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

Example

if (DCSObject)
{
    var imageviewer = DCSObject.getImageViewer("ImageViewerContainer");  // Get a specified image viewer
    imageviewer.ui.getZoom();  // Gets zoom factor for the image
}

See also

setImageViewMode()

setFitToWindowType()