get_workOnImageRectangle();
set_workOnImageRectangle(value);
!MISSING Scrap '_RTJavaScript_PROPERTY_SYNTAX'!
Type | Description |
---|---|
boolean | true to restrict the work area to the image rectangle; otherwise, it is false. The default value is true. |
If the current image size and scale in the viewer exposes part of the background, then clicking or touching on the background area not covered by the image may or may not start the work of this mode depending on this property.
Start with the ImageViewer example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:
Open the HTML page in your browser, now when you click the Example button, the value of WorkOnImageRectangle will be flipped. Click and drag on the background of the viewer not covered by the image to see the difference.
example: function SiteLibrary_DefaultPage$example(viewer) { var exampleLabel = document.getElementById("exampleLabel"); // Flip the value of WorkOnImageRectangle of the default interactive mode var interactiveMode = viewer.get_defaultInteractiveMode(); // Set its cursors if(interactiveMode.get_workOnImageRectangle()) { interactiveMode.set_workOnImageRectangle(false); exampleLabel.textContent = "WorkOnImageRectangle will be set to false, now when you click on the background not covered by the image, it will work" } else { interactiveMode.set_workOnImageRectangle(true); exampleLabel.textContent = "WorkOnImageRectangle will be set to true, now when you click on the background not covered by the image, it will not work" } },