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 |
---|---|
ArcView | ArcView |
ArcEditor | ArcEditor |
ArcInfo | ArcInfo |
Engine Developer Kit | Engine Runtime |