Converts a System.Drawing.Point in screen coordinates to a Point in Map coordinates.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim pixelPoint As Point
Dim transformationParams As TransformationParams
Dim value As Point
value = Point.ToMapPoint(pixelPoint, transformationParams) |
Parameters
- pixelPoint
- The screen Point to convert.
- 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 a screen point to map point. It obtains the TransformationParams from the Map control, which is assumed to be available as Map1.
C# | Copy Code |
---|
System.Drawing.Point screenPoint =
new System.Drawing.Point(125, 350);
// 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(
screenPoint, transParams); |
Visual Basic | Copy Code |
---|
Dim screenPoint As New System.Drawing.Point(125, 350)
' 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( _
screenPoint, transParams); |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also