ESRI.ArcGIS.ADF.Web
ToMapPoint(Int32,Int32,TransformationParams) Method
See Also  Example
ESRI.ArcGIS.ADF.Web.Geometry Namespace > Point Class > ToMapPoint Method : ToMapPoint(Int32,Int32,TransformationParams) Method




pixelX
The screen x-coordinate.
pixelY
The screen y-coordinate.
transformationParams
Information about the transformation, including map extent, size, projection and rotation, and whether the transformation is to map coordinates or to screen pixels.
Converts screen coordinates to a Point in Map coordinates.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function ToMapPoint( _
   ByVal pixelX As Integer, _
   ByVal pixelY As Integer, _
   ByVal transformationParams As TransformationParams _
) As Point
Visual Basic (Usage)Copy Code
Dim pixelX As Integer
Dim pixelY As Integer
Dim transformationParams As TransformationParams
Dim value As Point
 
value = Point.ToMapPoint(pixelX, pixelY, transformationParams)
C# 
public static Point ToMapPoint( 
   int pixelX,
   int pixelY,
   TransformationParams transformationParams
)

Parameters

pixelX
The screen x-coordinate.
pixelY
The screen y-coordinate.
transformationParams
Information about the transformation, including map extent, size, projection and rotation, and whether the transformation is to map coordinates or to screen pixels.

Return Value

Point in Map coordinates.

Example

This example converts x/y screen coordinates to a map point. It obtains the TransformationParams from the Map control, which is assumed to be available as Map1.
C#Copy Code
// Get transformation parameters from the Map control 

ESRI.ArcGIS.ADF.Web.Geometry.TransformationParams transParams = 

    Map1.GetTransformationParams( 

    ESRI.ArcGIS.ADF.Web.Geometry.TransformationDirection.ToMap); 

     

ESRI.ArcGIS.ADF.Web.Geometry.Point mapPoint = 

    ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint( 

    125, 350, transParams); 

    
Visual BasicCopy Code
' Get transformation parameters from the Map control

Dim transParams As ESRI.ArcGIS.ADF.Web.Geometry.TransformationParams = _

    Map1.GetTransformationParams( _

    ESRI.ArcGIS.ADF.Web.Geometry.TransformationDirection.ToMap)



Dim mapPoint As ESRI.ArcGIS.ADF.Web.Geometry.Point = _

    ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint( _

    125, 350, transParams);

Remarks

Use this form of the method instead of ToMapPoint(int, int, Envelope, int, int) in order to account for rotation of the Map. The transformationParams may be obtained from the Map with Map.GetTransformationParams.

See Also

© 2010 All Rights Reserved.