AO+C#设置栅格图层基高 制作三维

AO+C#设置栅格图层基高
2

private void setbaseheight()
        {
            ISceneGraph scenegraph = axSceneControl1.SceneGraph;
            IScene scene = scenegraph.Scene;
            ILayer layer;
            int j;
            

            layer = scene.get_Layer(0);

            IRasterLayer rlayer;
            rlayer = layer as IRasterLayer;
            IRaster raster;
            IRasterSurface rsurface = new RasterSurface();
            ISurface surface;

            raster = (IRaster)rlayer.Raster;

            IRasterBandCollection rasterbands = raster as IRasterBandCollection;
            IRasterBand rasterband = rasterbands.Item(0);
            rsurface.RasterBand = rasterband;
            surface = rsurface as ISurface;

            ILayerExtensions layerextensions = layer as ILayerExtensions;
            I3DProperties properties = new Raster3DPropertiesClass();
            int i;
            object p3d;
            for (i = 0; i < layerextensions.ExtensionCount; i++)
            {
                p3d = layerextensions.get_Extension(i);
                if (p3d != null)
                {
                    properties = (I3DProperties)p3d;
                    break;
                }

             
            }

            properties.BaseOption = esriBaseOption.esriBaseSurface;
            properties.BaseSurface = surface;
            properties.Apply3DProperties(layer);
        

            scenegraph = scene.SceneGraph;

            scenegraph.RefreshViewers();
         
        }

http://blog.gisforum.net/u/211/archives/2008/2013.html

你可能感兴趣的:(C#)