floaterTransform Property

Summary

Transformation matrix used by the floater image of this item.

Syntax

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

Property Value

The transformation matrix used by the floater image of this item. Default value is Identity.

Remarks

Use this transform to translate, scale or rotate the floater image. ImageViewerFloaterInteractiveMode will update this value when the user clicks and drags on the floater image.

Changing the value of this property will fire the ItemChanged event with ImageViewerItemChangedReason.FloaterTransform.

Example

JavaScript Example
var item = null; 
var image = null; 
 
if (this._imageViewer.items.count > 0) { 
   item = this._imageViewer.items.item(0); 
   canvas = item.canvas; 
} 
 
if (canvas == null) 
   return; 
 
if (item.floater == null) { 
   var ctx = canvas.getContext("2d"); 
   var imageData = ctx.getImageData(10, 10, item.size.width / 2, item.size.height / 2); 
 
   item.floater = document.createElement("canvas"); 
   var ctx = item.floater.getContext("2d"); 
   ctx.putImageData(imageData, imageData.width, imageData.height); 
 
   var transform = lt.LeadMatrix.identity; 
   transform.translate(-50, -50); 
   item.floaterTransform = lt.LeadMatrix.multiply(transform, item.floaterTransform); 
} 
else { 
   var floater = item.floater; 
 
   var transform = item.floaterTransform; 
   transform.translate(0, 100); 
   item.floaterTransform = lt.LeadMatrix.multiply(transform, item.floaterTransform); 
} 

Requirements

Target Platforms

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

Leadtools.Controls Assembly