LEADTOOLS JavaScript (Leadtools.Controls)
LEAD Technologies, Inc

WorkOnImageRectangle Property

Example 

Gets or sets a value that indicates whether to restrict the work area to the image rectangle.
Syntax
  get_workOnImageRectangle();
 set_workOnImageRectangle(value);
!MISSING Scrap '_RTJavaScript_PROPERTY_SYNTAX'!

Property Value

TypeDescription
booleantrue to restrict the work area to the image rectangle; otherwise, it is false. The default value is true.
Remarks

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.

Example

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.

  • JavaScript
  •   
     
    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"
       }
    },
See Also

Reference

ImageViewerInteractiveMode Object
ImageViewerInteractiveMode Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.