If activeView Is Nothing Then Return End If Dim screenDisplay As ESRI.ArcGIS.Display.IScreenDisplay = activeView.ScreenDisplay ' Constant screenDisplay.StartDrawing(screenDisplay.hDC, CShort(ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache)) Dim simpleMarkerSymbol As ESRI.ArcGIS.Display.ISimpleMarkerSymbol = New ESRI.ArcGIS.Display.SimpleMarkerSymbolClass Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleMarkerSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast screenDisplay.SetSymbol(symbol) Dim displayTransformation As ESRI.ArcGIS.Display.IDisplayTransformation = screenDisplay.DisplayTransformation ' X and Y are in device coordinates Dim point As ESRI.ArcGIS.Geometry.IPoint = displayTransformation.ToMapPoint(x, y) screenDisplay.DrawPoint(point) screenDisplay.FinishDrawing() End Sub
Public Function GetMapCoordinatesFromScreenCoordinates(ByVal screenPoint As ESRI.ArcGIS.Geometry.IPoint, ByVal activeView As ESRI.ArcGIS.Carto.IActiveView) As ESRI.ArcGIS.Geometry.IPoint If screenPoint Is Nothing OrElse screenPoint.IsEmpty OrElse activeView Is Nothing Then Return Nothing End If Dim screenDisplay As ESRI.ArcGIS.Display.IScreenDisplay = activeView.ScreenDisplay Dim displayTransformation As ESRI.ArcGIS.Display.IDisplayTransformation = screenDisplay.DisplayTransformation Return displayTransformation.ToMapPoint(CInt(screenPoint.X), CInt(screenPoint.Y)) End Function
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.