Exemple #1
0
        //渲染评价图
        public void RenderPJT()
        {
            if (this.RasterLayerClass != null)
            {
                RasterUniqueValueRendererClass rUV = new RasterUniqueValueRendererClass();

                rUV.Raster = this.RasterLayerClass.Raster;
                rUV.Update();
                rUV.HeadingCount = 1;
                rUV.set_ClassCount(0, 4);
                rUV.Field = "Value";

                //不适宜类
                rUV.AddValue(0, 0, 0);
                RgbColorClass fc1 = new RgbColorClass();
                fc1.Red   = 255; //红色
                fc1.Green = 0;
                fc1.Blue  = 0;
                rUV.set_Label(0, 0, "不适宜类");
                IFillSymbol cs1 = new SimpleFillSymbol();
                cs1.Color = fc1 as IColor;
                rUV.set_Symbol(0, 0, cs1 as ISymbol);

                //基本适宜类
                rUV.AddValue(0, 1, 1);
                RgbColorClass fc2 = new RgbColorClass();
                fc2.Red   = 255; //
                fc2.Green = 128;
                fc2.Blue  = 64;
                rUV.set_Label(0, 1, "基本适宜类");
                IFillSymbol cs2 = new SimpleFillSymbol();
                cs2.Color = fc2 as IColor;
                rUV.set_Symbol(0, 1, cs2 as ISymbol);

                //中度适宜类
                rUV.AddValue(0, 2, 2);
                RgbColorClass fc3 = new RgbColorClass();
                fc3.Red   = 141; //
                fc3.Green = 233;
                fc3.Blue  = 86;
                rUV.set_Label(0, 2, "中度适宜类");
                IFillSymbol cs3 = new SimpleFillSymbol();
                cs3.Color = fc3 as IColor;
                rUV.set_Symbol(0, 2, cs3 as ISymbol);

                //高度适宜类
                rUV.AddValue(0, 3, 3);
                RgbColorClass fc4 = new RgbColorClass();
                fc4.Red   = 0; //
                fc4.Green = 128;
                fc4.Blue  = 0;
                rUV.set_Label(0, 3, "高度适宜类");
                IFillSymbol cs4 = new SimpleFillSymbol();
                cs4.Color = fc4 as IColor;
                rUV.set_Symbol(0, 3, cs4 as ISymbol);

                this.RasterLayerClass.Renderer = rUV;
            }
        }