setFitToWindowType()

Description

Sets how the image is/should be resized to fit to the width or height of the viewer. To use the property under image mode, the page mode should be set to -1 by -1. The default value is EnumFitToWindowType.None.

Syntax

ImageViewerObject.ui.setFitToWindowType(iValue)

Parameters

<EnumFitToWindowType> iValue: the value to set

Return value

bool

Remarks

Before changing the value of fitToWindowType, make sure you have set the view mode to -1 by -1 using .ui.setImageViewMode().

Allowed Values Fit To Window Type
EnumFitToWindowType.FitToWindow Fit the image to both the width and height of the viewer

EnumFitToWindowType.None (default) Don’t fit to the viewer, zoomable

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

Example

             var imageviewer = DCSObject.getImageViewer("ImageViewerContainer");  // Get a specified image viewer
             imageviewer.ui.setImageViewMode(-1, -1);  // Set the view mode to -1 by -1
             imageviewer.ui.setFitToWindowType(imageviewer.ui.EnumFitToWindowType.FitToWindow);  // Fit the image to both the width and height of the viewer
      

See also

.ui.setImageViewMode()

.ui.getFitToWindowType()

Is this page helpful?

Leave a Reply

Your email address will not be published.