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




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 a point in map coordinates to a Point in screen coordinates (pixel coordinates).

Syntax

Visual Basic (Declaration) 
Public Overloads Function ToScreenPoint( _
   ByVal transformationParams As TransformationParams _
) As Point
Visual Basic (Usage)Copy Code
Dim instance As Point
Dim transformationParams As TransformationParams
Dim value As Point
 
value = instance.ToScreenPoint(transformationParams)
C# 
public Point ToScreenPoint( 
   TransformationParams transformationParams
)

Parameters

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

Screen-point (pixel-point) of converted map Point.

Example

This example converts a map point to screen point. It obtains the TransformationParams from the Map control, which is assumed to be available as Map1.
C#Copy Code
ESRI.ArcGIS.ADF.Web.Geometry.Point mapPoint = 

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

    -75.0, 35.0); 

     

// Get transformation parameters from the Map control 

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

    Map1.GetTransformationParams( 

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

     

System.Drawing.Point screenPoint = 

    mapPoint.ToScreenPoint(transParams); 

    
Visual BasicCopy Code
Dim mapPoint As New _

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

    -75.0, 35.0)



' Get transformation parameters from the Map control

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

    Map1.GetTransformationParams( _

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



Dim screenPoint As System.Drawing.Point = _

    mapPoint.ToScreenPoint(transParams)

Remarks

Use this form of the method instead of ToScreenPoint(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.