←Select platform

ImageViewerCoordinateType Enumeration

Summary

Defines the coordinate system of a point.

Syntax
C#
C++/CLI
public enum ImageViewerCoordinateType 
public enum class ImageViewerCoordinateType sealed 
Members

0

Control

(0) Point is in control (client) coordinate. For example obtained from a mouse or touch event

1

View

(1) View coordinate. Transform using ImageViewer.ViewTransform

2

Item

(2) Item coordinates. Transform using ImageViewer.GetItemTransform

3

Content

(3) Content coordinates. Transform using ImageViewer.GetItemContentTransform

4

Image

(4) Image coordinates. Transform using ImageViewer.GetItemImageTransform

5

Floater

(5) Floater coordinates. Transform using ImageViewer.GetItemFloaterTransform

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

See Also

Reference

Leadtools.Controls Namespace

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.