←Select platform

ImageTransform Property

Summary

Current transformation matrix used for displaying the image (single item mode).

Syntax
C#
C++/CLI
public virtual LeadMatrix ImageTransform { get; } 
public:  
   virtual property LeadMatrix^ ImageTransform 
   { 
      LeadMatrix^ get() 
   } 

Property Value

The current transformation matrix used for displaying the image (single item mode).

Remarks

This is a helper property for applications that use ImageViewer in single item mode. It is a shortcut to GetItemImageTransform using ActiveItem. For more information, refer to Image Viewer in Single Item Mode.

Example
C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
 
public void ImageViewerItemTransform_Example(int dy, LeadPoint position) 
{ 
   double total = _imageViewer.GetItemViewBounds(_imageViewer.ActiveItem, ImageViewerItemPart.Item, false).Height; 
   double factor; 
 
   if (total > 0) 
      factor = 1.0 - (dy * 2.0) / total; 
   else 
      factor = 1.0; 
 
   // Get the origin in image coordinate 
   var origin = _imageViewer.ConvertPoint(_imageViewer.ActiveItem, ImageViewerCoordinateType.Control, ImageViewerCoordinateType.Image, position).ToLeadPointD(); 
   // Convert it to whatever the current transform is 
   origin = _imageViewer.ActiveItem.Transform.Transform(origin); 
 
   var transform = LeadMatrix.Identity; 
   transform.ScaleAt(1 / factor, 1 / factor, origin.X, origin.Y); 
   _imageViewer.ActiveItem.Transform = LeadMatrix.Multiply(_imageViewer.ActiveItem.Transform, transform); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.24
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.