Error processing SSI file
LEADTOOLS JavaScript (Leadtools.Controls)

TranslateItemScaleFactor Method

Show in webframe
Example 
The item to translate. This parameter cannot be null.
Number of pixels to translate the item horizontally.
Number of pixels to translate the item vertically.
true to reset the item state transformations, otherwise; false.
Translates an item horizontally or vertically a given amount of pixels regardless of the current zoom value.
Syntax
 function Leadtools.Controls.ImageViewer.translateItemScaleFactor( 
   item ,
   dx ,
   dy ,
   resetValues 
)

Parameters

ParameterTypeDescription
itemImageViewerItemThe item to translate. This parameter cannot be null.
dxdoubleNumber of pixels to translate the item horizontally.
dydoubleNumber of pixels to translate the item vertically.
resetValuesbooltrue to reset the item state transformations, otherwise; false.
Remarks

This is a helper method to quickly transform an item a specified amount of pixels regardless of the current zoom value.

Example

This example will add a few items to the ImageViewer and then create a new interactive mode that transform the item using mouse or touch.

Run the demo. Click on any item and drag to translate, CTRL-click to zoom the item in and out.

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:

function ImageViewer_TranslateItemScaleFactor(dx, dy) {
   if (dx == 0 && dy == 0)
      return;
   this._imageViewer.translateItemScaleFactor(this._imageViewer.activeItem, -dx, -dy, true);
}
See Also

Reference

ImageViewer Object
ImageViewer Members

Error processing SSI file