ESRI.ArcGIS.ADF.Web
ToMapEnvelope(Rectangle,TransformationParams) Method
See Also  Example
ESRI.ArcGIS.ADF.Web.Geometry Namespace > Envelope Class > ToMapEnvelope Method : ToMapEnvelope(Rectangle,TransformationParams) Method




screenRectangle
transformationParameters
Converts screen rectangle into a map envelope.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function ToMapEnvelope( _
   ByVal screenRectangle As Rectangle, _
   ByVal transformationParameters As TransformationParams _
) As Envelope
Visual Basic (Usage)Copy Code
Dim screenRectangle As Rectangle
Dim transformationParameters As TransformationParams
Dim value As Envelope
 
value = Envelope.ToMapEnvelope(screenRectangle, transformationParameters)
C# 
public static Envelope ToMapEnvelope( 
   Rectangle screenRectangle,
   TransformationParams transformationParameters
)

Parameters

screenRectangle
transformationParameters

Return Value

The map envelope.

Example

This example converts a screen rectangle to an envelope in map coordinates.
C#Copy Code
// Create rectangle (x, y, width, height) 

System.Drawing.Rectangle screenRectangle = 

    new System.Drawing.Rectangle(35, 125, 200, 200); 

  

// 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.Envelope mapEnvelope = 

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

    screenRectangle); 

    
Visual BasicCopy Code
' Create rectangle (x, y, width, height)

Dim screenRectangle As New System.Drawing.Rectangle(35, 125, 200, 200)



' 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 mapEnvelope As ESRI.ArcGIS.ADF.Web.Geometry.Envelope = _

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

    screenRectangle)

Remarks

Use this form of the method instead of the other forms of ToMapEnvelope 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.