首页 新闻 会员 周边 捐助

ArcEngine请问如何给特定的像元值赋给特定的颜色呀?

0
悬赏园豆:50 [待解决问题]

或者问一下,如何对栅格图像进行唯一值渲染

星星小夜曲的主页 星星小夜曲 | 初学一级 | 园豆:152
提问于:2017-06-08 17:13
< >
分享
所有回答(1)
0

http://gishuangjun.blog.sohu.com/139346974.html

风行天下12 | 园豆:3867 (老鸟四级) | 2017-06-08 17:43

这个是对要素图层渲染,有属性表信息,而我的数据是栅格图像,没有属性表,不能用这种方式。下面这种方式最适合,但是不知道为什么少了一种颜色,您能帮忙看看吗。结果是没有白色。蓝色赋给了两种值

IRasterClassifyColorRampRenderer ClassifyColor = new RasterClassifyColorRampRendererClass();
IRasterRenderer RasterRender = ClassifyColor as IRasterRenderer;
//RasterRender.Raster = RasterLayer.Raster;

//断点设置
ClassifyColor.ClassCount = 6;
ClassifyColor.set_Break(0, 0);
ClassifyColor.set_Break(1, BreakPoint1);
ClassifyColor.set_Break(2, BreakPoint2);
ClassifyColor.set_Break(3, BreakPoint3);
ClassifyColor.set_Break(4, BreakPoint4);
ClassifyColor.set_Break(5, BreakPoint5);
//各个分类的颜色设置
IFillSymbol Symbol = new SimpleFillSymbolClass() as IFillSymbol;
Symbol.Color = new RgbColor() { Red = 0, Green = 0, Blue = 0 }; //0 黑色
ClassifyColor.set_Symbol(0, Symbol as ISymbol);
Symbol.Color = new RgbColor() { Red = 255, Green = 255, Blue = 0 };//1 黄色
ClassifyColor.set_Symbol(1, Symbol as ISymbol);
Symbol.Color = new RgbColor() { Red = 0, Green = 255, Blue = 0 };//2 150
ClassifyColor.set_Symbol(2, Symbol as ISymbol);
Symbol.Color = new RgbColor() { Red = 255, Green = 0, Blue = 0 };//3 200
ClassifyColor.set_Symbol(3, Symbol as ISymbol);
Symbol.Color = new RgbColor() { Red = 255, Green = 255, Blue = 255 };//0
ClassifyColor.set_Symbol(4, Symbol as ISymbol);
Symbol.Color = new RgbColor() { Red = 0, Green = 0, Blue = 255 };//5 255 5 50
ClassifyColor.set_Symbol(5, Symbol as ISymbol);
RasterLayer.Renderer = RasterRender;

 

 

支持(0) 反对(0) 星星小夜曲 | 园豆:152 (初学一级) | 2017-06-10 11:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册