←Select platform

ConvertRect Method

Summary

Converts the specified rectangle from one CoordinateType to another.

Syntax

C#
VB
Java
Objective-C
WinRT C#
public virtual Rect ConvertRect(  
   Leadtools.Controls.CoordinateType sourceType, 
   Leadtools.Controls.CoordinateType destinationType, 
   Rect rect 
) 
Public Overridable Function ConvertRect( _ 
   ByVal sourceType As Leadtools.Controls.CoordinateType, _ 
   ByVal destinationType As Leadtools.Controls.CoordinateType, _ 
   ByVal rect As Rect _ 
) As Rect 
public virtual Rect ConvertRect(  
   Leadtools.Controls.CoordinateType sourceType, 
   Leadtools.Controls.CoordinateType destinationType, 
   Rect rect 
) 
- (CGRect)convertRect:(CGRect)rect  
           sourceType:(LTCoordinateType)src  
             destType:(LTCoordinateType)dst; 
 
macOS Only (flipped around Y axis)     
- (CGRect)convertRect_osx:(CGRect)rect  
               sourceType:(LTCoordinateType)src  
                 destType:(LTCoordinateType)dst; 
public RectF convertRect(CoordinateType sourceType, 
                         CoordinateType destType,  
                         RectF rect) 
              
 function Leadtools.Controls.ImageViewer.ConvertRect(  
   sourceType , 
   destinationType , 
   rect  
) 

Parameters

sourceType
The source coordinate type.

destinationType
The destination coordinate type.

rect
The rectangle to be converted.

Return Value

The converted rectangle, in the destination coordinate type.

Remarks

Use this method to convert a rectangle value from control to image coordinates or back. This method will simply multiply the rectangle value by the transformation matrix (Transform) when converting from image to control coordinates and by the inverse of this matrix when converting from control to image coordinate.

If sourceType has the same value as destinationType, then this method will return a value equal to rect.

Example

For an example, refer to ImageViewerRubberBandInteractiveMode.

Requirements

Target Platforms

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

Leadtools.Controls Assembly (WinRT / WPF / iOS / OS X / Android)