LEADTOOLS JavaScript (Leadtools.Controls)
LEAD Technologies, Inc

Invert Property

Example 

Gets or sets a value that indicates whether to invert the image.
Syntax
  get_invert();
 set_invert(value);
!MISSING Scrap '_RTJavaScript_PROPERTY_SYNTAX'!

Property Value

TypeDescription
booleantrue to invert the image; otherwise, it is false. Default value is false.
Remarks

Changing the value of this property will fire the PropertyChanged event and calls Invalidate.

When the value of this property is flipped between true and false, the image in BackCanvas will be inverted. Unlike Flip, Reverse and RotateAngle, the image data will change.

Note that the viewer will use HTML 5 getImageData on the back canvas. If the URL of the image is not in the same domain, a security error might occur. For more information, refer to getImageData.

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 image will invert and invert back.

  • JavaScript
  •   
     
    example: function SiteLibrary_DefaultPage$example(viewer) {
       // Flip the state of invert
       viewer.set_invert(!viewer.get_invert());
    },
See Also

Reference

ImageViewer Object
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

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