Equivalent of AxMapControl interface in ArcMap

08-11-2015 10:48 AM
New Contributor II

I want to draw a graphic in current visible portion of the map.I am using

DrawGraphic(0,0,0axMapControl.Width, axMapControl.Height) in stand-alone ArcEngine application.Both Height and Width in this case return Integer.What is the equivalent of this,if the same has to be done in ArcMap.?

0 Kudos
2 Replies
Occasional Contributor

Do you want to get the width and height of map, or do you want the method to draw graphics? If you want equivalent of axMapControl.width and height, then get active view first, then get ActiveView.Extent (ArcObjects Help for .NET developers​) It returns IEnvelope, which has height and width (ArcObjects Help for .NET developers). Is it what you are looking for?

New Contributor II

Thanks,I figured it out. tagRECT is giving me current extent.

IActiveView activeView = ArcMap.Document.FocusMap as IActiveView;

IDisplayTransformation DT = activeView.ScreenDisplay.DisplayTransformation;

tagRECT deviceRECT = DT.get_DeviceFrame();

0 Kudos