ESRI.ArcGIS.ADF.Web
ToScreenRectangle Method
See Also  Example
ESRI.ArcGIS.ADF.Web.Geometry Namespace > Envelope Class : ToScreenRectangle Method




transformationParams
Converts an envelope in map coordinates to a Rectangle in screen coordinates (pixel coordinates).

Syntax

Visual Basic (Declaration) 
Public Function ToScreenRectangle( _
   ByVal transformationParams As TransformationParams _
) As Rectangle
Visual Basic (Usage)Copy Code
Dim instance As Envelope
Dim transformationParams As TransformationParams
Dim value As Rectangle
 
value = instance.ToScreenRectangle(transformationParams)
C# 
public Rectangle ToScreenRectangle( 
   TransformationParams transformationParams
)

Parameters

transformationParams

Return Value

Screen-rectangle of converted map envelope.

Example

This example converts a map envelope to a rectangle in screen pixel coordinates.
C#Copy Code
ESRI.ArcGIS.ADF.Web.Geometry.Envelope mapEnvelope = 

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

    25.0, -4.5, 27.0, -6.5); 

     

// 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.Rectangle screenRectangle = 

    mapEnvelope.ToScreenRectangle(transParams); 

    
Visual BasicCopy Code
Dim mapEnvelope As New _

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

    25.0, -4.5, 27.0, -6.5)



' 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 screenRectangle As System.Drawing.Rectangle = _

    mapEnvelope.ToScreenRectangle(transParams)

Remarks

The transformationParams may be obtained from the Map with Map.GetTransformationParams.

See Also

© 2010 All Rights Reserved.