C# AE 显示tiff文件,GDAL的Dataset读的数据,下面是我显示部分,为什么出来以后是黑色?
IRasterLayerprasterLayer=newRasterLayer();//新建栅格图层IRasterpraster=prasterLayer.Raster;...
IRasterLayer prasterLayer = new RasterLayer();//新建栅格图层
IRaster praster = prasterLayer.Raster;
IRasterRGBRenderer rasterRGBRender = new RasterRGBRenderer();
IRasterRenderer prasterRender = rasterRGBRender as IRasterRenderer;
prasterRender.Raster = praster;
prasterRender.Update();
int[] color_index = new int[3];//获取RGB颜色对应波段的索引值
color_index = loadDlg.Getcolor;
rasterRGBRender.RedBandIndex = color_index[0];
rasterRGBRender.GreenBandIndex = color_index[1];
rasterRGBRender.BlueBandIndex = color_index[2];
prasterLayer.Renderer = (IRasterRenderer)rasterRGBRender;////三个波段值分别赋予RGB然后传给
prasterRender.Update();
prasterLayer.CreateFromDataset(prasterDataset);//pRasterDataset传值给栅格图层
this.axMapControl1.Map.AddLayer(prasterLayer);////给axMapControl1增加栅格图层并传值
this.axMapControl1.ActiveView.Refresh();//刷新控件axMapControl1 展开
IRaster praster = prasterLayer.Raster;
IRasterRGBRenderer rasterRGBRender = new RasterRGBRenderer();
IRasterRenderer prasterRender = rasterRGBRender as IRasterRenderer;
prasterRender.Raster = praster;
prasterRender.Update();
int[] color_index = new int[3];//获取RGB颜色对应波段的索引值
color_index = loadDlg.Getcolor;
rasterRGBRender.RedBandIndex = color_index[0];
rasterRGBRender.GreenBandIndex = color_index[1];
rasterRGBRender.BlueBandIndex = color_index[2];
prasterLayer.Renderer = (IRasterRenderer)rasterRGBRender;////三个波段值分别赋予RGB然后传给
prasterRender.Update();
prasterLayer.CreateFromDataset(prasterDataset);//pRasterDataset传值给栅格图层
this.axMapControl1.Map.AddLayer(prasterLayer);////给axMapControl1增加栅格图层并传值
this.axMapControl1.ActiveView.Refresh();//刷新控件axMapControl1 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询