LEADTOOLS JavaScript (Leadtools.Controls)

Invert Property

Show in webframe
Example 
Gets or sets a value that indicates whether to invert the image.
Syntax
get_invert();
set_invert(value);
Object.defineProperty('invert');

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 BackImage or 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.

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-2014 All Rights Reserved. LEAD Technologies, Inc.