←Select platform

ConvertObjectToLogicalRectangle Method

Summary

Converts a rectangle from object to logical coordinates.

Syntax

C#
VB
C++
public AnnRectangle ConvertObjectToLogicalRectangle( 
   AnnRectangle rect 
) 
  
Public Function ConvertObjectToLogicalRectangle( _ 
   ByVal rect As Leadtools.Annotations.AnnRectangle _ 
) As Leadtools.Annotations.AnnRectangle 
public: 
Leadtools.Annotations.AnnRectangle ConvertObjectToLogicalRectangle(  
   Leadtools.Annotations.AnnRectangle rect 
)  

Parameters

rect
A rectangle in object coordinates.

Return Value

A rectangle object containing the result in logical coordinates.

Remarks

An AnnObject may contain various points, lines, curves and rectangles that denote the object coordinates and where it should be drawn on an image. Also, the AnnObject contains a System.Drawing.Drawing2D.Matrix object that may be updated with a transformation when the object is moved, rotated or sized. This transformation as well as the container own transformation are used to translate an object point to image coordinates and then to the screen.

The coordinates stored in the object (for example, AnnLineObject.StartPoint or AnnRectangleObject.Bounds are called object coordinates. These coordinates do not translate 1 to 1 to pixel values on the image used in the annotations because of the transformation matrices involved.

The values corresponding to the object coordinates in pixels are called logical coordinates. For example, a logical coordinate of AnnLineObject.StartPoint is its pixel value (in top left-position) in the image it is annotating. Converting from object to logical coordinates is what happens when you call the AnnAutomation.Realize method.

To manipulate an object position and size manually from outside the annotation framework, you need to first convert its coordinates to logical values, perform your own transformations, and convert them back to object coordinates before setting them back to the object.

To convert a point or a group of points from object to logical coordinates, use the ConvertObjectToLogicalPoints method.

To convert a point or a group of points from logical to object coordinates, use the ConvertLogicalToObjectPoints method.

To convert a rectangle from object to logical coordinates, use the ConvertObjectToLogicalRectangle method.

To convert a rectangle from logical to object coordinates, use the ConvertLogicalToObjectRectangle method.

For an example on converting object to logical and back to object coordinates, refer to ConvertLogicalToObjectPoints.

Example

For an example, refer to ConvertObjectToLogicalPoints.

Requirements

Target Platforms

See Also

Reference

AnnObject Class

AnnObject Members

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

Leadtools.Annotations Assembly