I am trying to build an add-in that will create a polygon from the current map extent. This is not a problem in Data View where I can easily get the envelope of an iMxDocument:iActiveView in data view. I need to do the same in Layout view, preferably without switching back and forth between layout and data views.
When in Layout the iActiveView:Extent:Envelope returns an envelope coordinates of the map position with respect to the layout. (position of the map frame on paper so to speak) How do I transform these into actual map coordinates? I tried using iDisplayTransoformation:ToMapPoint but the input needs to be a screen point and the coordinates I have are of the map frame with respect to layout, not screen coordinates.
In other words i need to transform page units to map units whereas iDisplayTransformation will transform only screen nits to map units or screen units to page units.