Initializes the map context.
[Visual Basic .NET] Public Sub Init ( _ ByVal mapProj As ISpatialReference, _ ByVal mapRefScale As Double, _ ByVal mapExtent As IEnvelope _ )
[C#] public void Init ( ISpatialReference mapProj, double mapRefScale, IEnvelope mapExtent );
[C++]
HRESULT Init(
ISpatialReference* mapProj,
double mapRefScale,
IEnvelope* mapExtent
);
[C++]Parameters
mapProj [in]mapProj is a parameter of type ISpatialReference
mapRefScale [in] mapRefScale is a parameter of type double mapExtent [in]mapExtent is a parameter of type IEnvelope
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Remarks
Use this method when you create a reference to a new MapContext object to initialize the mapcontext. If a reference to a DisplayTransformation exists, then use IMapContext::InitFromDisplay method to initialize the map context. It is important to initialize the map context as this will help in getting correct context for displaying and drawing geometric effects and marker placements.
'initialize new mapcontext using a feature class's spatial reference and extent
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