Error processing SSI file
LEADTOOLS JavaScript (Leadtools.Controls)

Transform Property (ImageViewerItem)

Show in webframe
Example 
Transformation of the item.
Syntax
get_transform();
set_transform(value);
Object.defineProperty('transform');

Property Value

TypeDescription
LeadMatrixThe transformation of the item. Default value is Identity.
Remarks

Transform will be used by ViewLayout during the calculation. The rectangle from 0,0 to ImageSize is multiplied by this value apply custom translation, scale and rotation on the item.

Modifying the state values will update this matrix automatically and setting the value of Transform manually will reset the state values to their default values. For more information, for more information, refer Image Viewer Transformation.

For more information, refer Image Viewer Items.

Example
function ImageViewer_Transform(dy, position) {
   var total = this._imageViewer.getItemViewBounds(this._imageViewer.activeItem, lt.Controls.ImageViewerItemPart.item, false).height;
   var factor;
   if (total > 0)
      factor = 1.0 - (dy * 2.0) / total;
   else
      factor = 1.0;

   // Get the origin in image coordinate
   var origin = this._imageViewer.convertPoint(this._imageViewer.activeItem, lt.Controls.ImageViewerCoordinateType.control, lt.Controls.ImageViewerCoordinateType.image, position);
   // Convert it to whatever the current transform is
   origin = this._imageViewer.activeItem.transform.transformPoint(origin);

   var transform = lt.LeadMatrix.identity;
   transform.scaleAt(1 / factor, 1 / factor, origin.x, origin.y);
   this._imageViewer.activeItem.transform = lt.LeadMatrix.multiply(this._imageViewer.activeItem.transform, transform);
};
See Also

Reference

ImageViewerItem Object
ImageViewerItem Members

Error processing SSI file