LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

ImageToViewerPoint Method






The point in image coordinates.
true if point is already in the image view-perspective. false if point is in top-left coordinates.
Converts a point in image coordinates to viewer coordinates.
Syntax
public Point ImageToViewerPoint( 
   Point point,
   bool accountForViewPerspective
)
'Declaration
 
Public Function ImageToViewerPoint( _
   ByVal point As Point, _
   ByVal accountForViewPerspective As Boolean _
) As Point
'Usage
 
Dim instance As RasterImageViewer
Dim point As Point
Dim accountForViewPerspective As Boolean
Dim value As Point
 
value = instance.ImageToViewerPoint(point, accountForViewPerspective)
public Point ImageToViewerPoint( 
   Point point,
   bool accountForViewPerspective
)
 function Leadtools.WinForms.RasterImageViewer.ImageToViewerPoint( 
   point ,
   accountForViewPerspective 
)
public:
Point ImageToViewerPoint( 
   Point point,
   bool accountForViewPerspective
) 

Parameters

point
The point in image coordinates.
accountForViewPerspective
true if point is already in the image view-perspective. false if point is in top-left coordinates.

Return Value

A System.Drawing.Point object containing the point coordinates.
Remarks

This method converts a point from image (logical) to viewer (physical) coordinates. The viewer coordinates is what you are currently seeing on the screen. It contains the current scale and scroll values (as well as any padding if set). For example, when you use the RasterViewerInteractiveMode.UserRectangle, the value obtained from the RasterViewerRectangleEventArgs.Rectangle parameter to the InteractiveUserRectangle event is in physical coordinates. If you need to convert this value to image coordinates (for example, to use it as a region or to find the exact pixel coordinate of this rectangle in the image) then you should use the ViewerToImageRectangle method.

When accountForViewPerspective is set to true, it is assumed that point is already in the correct view perspective of the as the current image (RasterImage.ViewPerspective), therefore, no conversion to top-left (which what the physical coordinates are always in) is performed. If however this value is false, then this method will convert point to top-left coordinates before converting it to physical coordinates.

To convert a point from viewer (physical) to image (logical) coordinates, use the ViewerToImagePoint method.

To convert a rectangle from image to viewer coordinates and back, use ImageToViewerRectangle and ViewerToImageRectangle.

Example
For an example, refer to InteractiveUserRectangle.
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

RasterImageViewer Class
RasterImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

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