[ArcGIS Engine]栅格数据处理 RasterDataset RasterLayer Raster RasterBandCollection

原文 http://www.cnblogs.com/zoe-j/archive/2012/03/22/2412403.html

1.由RasterLayer 得到RasterDataset

复制代码
1  IRasterLayer myrasterlayer = MapControl.Map.Layer[index] as IRasterLayer;
2 IRaster myRaster = myrasterlayer.Raster;
3 IRasterBandCollection myRasterBandCollection = myRaster as IRasterBandCollection;
4 IRasterBand myRasterBand = myRasterBandCollection.Item(0);
5 IRasterDataset myRasterDataset = myRasterBand as IRasterDataset;
复制代码

 

2.由RasterDataset 到RasterLayer

1  IRasterLayer pRasterLayer = new RasterLayerClass(); 
2
3 pRasterLayer.CreateFromDataset(pRasterDataset);
4
5 axMapControl1.Map.AddLayer(pRasterLayer as ILayer); ;

你可能感兴趣的:(ArcGis Engine)