LEADTOOLS JavaScript (Leadtools.Controls)

BeginUpdate Method

Show in webframe
Example 
Stops the viewer from being updated if any change is applied. This is useful to increase the control's speed efficiency.
Syntax
 function Leadtools.Controls.ImageViewer.beginUpdate()
Remarks

The BeginUpdate method will cause the control to not update the image viewing transformation or invalidate the display when any changes to the control's properties or the image is applied. When the user calls the EndUpdate method, the viewer will then update the transformation and invalidate the display to show all the changes that have been made.

For better visual results and for speed efficiency, it is recommended you surround multiple calls that will cause a render or transformation change between BeginUpdate and EndUpdate.

Calls to BeginUpdate and EndUpdate are accumulative. Each call to BeginUpdate must be matched with a corresponding call to EndUpdate or else updates to the transform won't be applied.

To determine if the control will currently update the transform and invalidate, use CanUpdate.

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 viewer will flip the image, zooms it by 2 and scroll it by 100, 100 pixels all in one render operation.

example: function SiteLibrary_DefaultPage$example(viewer) {
   // Disable updating
   viewer.beginUpdate();

   // Flip
   viewer.set_flip(true);
   // Zoom
   viewer.zoom(lt.Controls.ImageViewerSizeMode.none, 2, viewer.get_imageControlCenter());
   // Scroll
   viewer.scrollBy(lt.LeadPointD.create(100, 100));

   // Show the results
   viewer.endUpdate();
},
See Also

Reference

ImageViewer Object
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.