transform Property

Summary

Transformation of the item.

Syntax

JavaScript Syntax
Object.defineProperty(ImageViewerItem.prototype, 'transform', 
	get: function(), 
	set: function(value) 
) 
TypeScript Syntax
transform: LeadMatrix; 

Property Value

The 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

JavaScript 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); 
}; 

Requirements

Target Platforms

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly