Getting screen coordinates from map coordinates
Call GetScreenCoordinatesFromMapCoordinates by passing in an IPoint that contains the real world (map) coordinates. An IPoint that contains the x,y device (screen) coordinates for your Windows application is returned.
See the following:
[Java]
public IPoint getScreenCoordinatesFromMapCoorindates(IPoint mapPoint, IActiveView
activeView)throws Exception{
if (mapPoint == null || mapPoint.isEmpty() || activeView == null)
return null;
IScreenDisplay screenDisplay = activeView.getScreenDisplay();
IDisplayTransformation displayTransformation =
screenDisplay.getDisplayTransformation();
int x[] = new int[1];
int y[] = new int[1];
displayTransformation.fromMapPoint(mapPoint, x, y);
IPoint returnPoint = new Point();
returnPoint.putCoords(x[0], y[0]);
return returnPoint;
}
See Also:
Convert screen coordinates to map coordinatesDevelopment licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |
Engine Developer Kit | Engine |