ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ScreenToMap Method
The point value in screen coordinates.
Example

In This Topic
    ScreenToMap Method (MapView)
    In This Topic
    Converts a point in screen coordinates to a point in the coordinates of the map or scene. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function ScreenToMap( _
       ByVal screenPoint As Point _
    ) As MapPoint
    public MapPoint ScreenToMap( 
       Point screenPoint
    )

    Parameters

    screenPoint
    The point value in screen coordinates.

    Return Value

    The converted point in map coordinates.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Calculate Selection tolerance in map units
    {
      //Selection tolerance for the map in pixels
      var selectionTolerance = SelectionEnvironment.SelectionTolerance;
      // Note: Needs QueuedTask to run
      {
        //Get the map center
        var mapExtent = MapView.Active.Map.GetDefaultExtent();
        var mapPoint = mapExtent.Center;
        //Map center as screen point
        var screenPoint = MapView.Active.MapToScreen(mapPoint);
        //Add selection tolerance pixels to get a "radius".
        var radiusScreenPoint = new System.Windows.Point(screenPoint.X + selectionTolerance, screenPoint.Y);
        var radiusMapPoint = MapView.Active.ScreenToMap(radiusScreenPoint);
        //Calculate the selection tolerance distance in map units.
        var searchRadius = GeometryEngine.Instance.Distance(mapPoint, radiusMapPoint);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also