ArcObjects Library Reference (Display)  

IMapContext Interface

Provides access to the context in which geometric effects and marker placements work.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Method FromGeographyToMap Converts geographic geometry to map context geometry.
Method FromMapToGeography Converts map context geometry to geographic geometry.
Method FromPoints Converts a distance expressed in points into a geographic distance.
Method Init Initializes the map context.
Method InitFromDisplay Initializes the map context using a display transformation.
Read-only property ReferenceScale The reference scale of the map.
Read-only property SpatialReference The spatial reference of the map.
Method ToPoints Converts a geographic distance into a distance expressed in points.

CoClasses that implement IMapContext

CoClasses and Classes Description
MapContext The context in which geometric effects and marker placement work.

Remarks

Spatial Reference and Reference Scale information is used to define a Map Context.

A Feature Representation has to be initiated with a map context to make itself valid.

'How to initialize mapcontext
Dim pMapContext As IMapContext
Dim pGFClass As IGeoDataset
Set pMapContext = New MapContext
Set pGFClass = pFClass
pMapContext.Init pGFClass.SpatialReference, 25000, pGFClass.Extent
Set pRepresentation = pRepClass.GetRepresentation(pFeat, pMapContext)
'where pFeat is reference to a Feature object and pFClass is reference to a FeatureClass object
  'How to Initialize a mapcontext using the DisplayTransformation 
  Dim pMC As IMapContext
  Set pMC = New MapContext
  Dim pDisp As IDisplayTransformation
  Dim pAV as IActiveView
  Set pAV = pMxDoc.ActiveView
  Set pDisp = pAV.ScreenDisplay.DisplayTransformation
  pMC.InitFromDisplay pDisp