http://resources.esri.com/help/9.3/arcgisengine/dotnet/0c13ab62-2579-4b37-9933-e034d77d6fe5.htm
public static void AddRasterCatalogLayer(ESRI.ArcGIS.Carto.IActiveView activeView, ESRI.ArcGIS.Geodatabase.IRasterCatalog rasterCatalog) { //Create a raster catalog layer. ESRI.ArcGIS.Carto.IGdbRasterCatalogLayer rastercatalogLayer = new GdbRasterCatalogLayerClass(); rastercatalogLayer.Setup((ITable)rasterCatalog); //Add it to map if the layer is valid. if (!(rastercatalogLayer == null)) { ESRI.ArcGIS.Carto.IMap map = activeView.FocusMap; map.AddLayer((ILayer)rastercatalogLayer); } }
Public Shared Sub AddRasterCatalogLayer(ByVal activeView As ESRI.ArcGIS.Carto.IActiveView, ByVal rasterCatalog As ESRI.ArcGIS.Geodatabase.IRasterCatalog) 'Create a raster catalog layer. Dim rastercatalogLayer As ESRI.ArcGIS.Carto.IGdbRasterCatalogLayer = New GdbRasterCatalogLayerClass() rastercatalogLayer.Setup(CType(rasterCatalog, ITable)) 'Add it to map if the layer is valid. If Not (rastercatalogLayer = Nothing) Then Dim map As ESRI.ArcGIS.Carto.IMap = activeView.FocusMap map.AddLayer(CType(rastercatalogLayer, ILayer)) End If End Sub
'VBA 10 Help Public Function CreateGeodatabaseRasterLayer(pRasterWsExt As IRasterWorkspaceEx, sName As String) As IGdbRasterCatalogLayer 'pRasterWsExt represets the workspace where the raster catalog resides. 'sName is the name of the raster catalog On Error GoTo erh 'Open the raster catalog Dim pRasterCatalog As IRasterCatalog Set pRasterCatalog = pRasterWsExt.OpenRasterCatalog(sName) 'Create the GdbRasterCatalogLayer Dim pGdbRasterCatalogLy As IGdbRasterCatalogLayer Set pGdbRasterCatalogLy = New GdbRasterCatalogLayer If Not pGdbRasterCatalogLy.Setup(pRasCatalog) = True Then Exit Function Set CreateGeodatabaseRasterLayer = pGdbRasterCatalogLy erh: Set CreateGeodatabaseRasterLayer = Nothing End Function