LEADTOOLS WPF and Silverlight (Leadtools.Windows.Controls assembly)
LEAD Technologies, Inc

BoundsToImageCoordinates Method (ImageViewer)






The source rectangle in control (display) coordinates.
Converts a rectangle from control (display) to image coordinates. .NET support Silverlight support
Syntax
public virtual Rect BoundsToImageCoordinates( 
   Rect rect
)
'Declaration
 
Public Overridable Function BoundsToImageCoordinates( _
   ByVal rect As Rect _
) As Rect
'Usage
 
Dim instance As ImageViewer
Dim rect As Rect
Dim value As Rect
 
value = instance.BoundsToImageCoordinates(rect)
public virtual Rect BoundsToImageCoordinates( 
   Rect rect
)
 function Leadtools.Windows.Controls.ImageViewer.BoundsToImageCoordinates( 
   rect 
)
public:
virtual Rect BoundsToImageCoordinates( 
   Rect rect
) 

Parameters

rect
The source rectangle in control (display) coordinates.

Return Value

A System.Windows.Rect that contains the converted values in image coordinates.
Remarks

The viewer control contain many properties that control how the image will be displayed on the surface of the control. At any time, you might require to convert a point or a rectangle from control (where it is on the surface of the control) to image (the pixel x and y value in the image data) and vice versa.

Use PointToImageCoordinates to convert a point from control to image coordinates, use PointFromImageCoordinates to convert a point from image to control coordinates. Use BoundsToImageCoordinates to convert a rectangle value from control to image coordinates and BoundsFromImageCoordinates to convert a rectangle value from image to control coordinates.

Note that when using the RasterImageBox and RasterImageViewer controls to display a LEADTOOLS Leadtools.RasterImage object, the image coordinates are assumed to be in top-left view perspective. If the image contains a RasterImage.ViewPerspective value other than RasterViewPerspective.TopLeft you must call RasterImage.PointToImage or RasterImage.RectangleToImage to further convert the values to actual rows and columns pixel values in the image.

Example

For C#/VB examples, refer to PointToImageCoordinates.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ImageViewer Class
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.