コード例 #1
0
 private void btnRasterOK_Click(object sender, EventArgs e)
 {
     try
     {
         RasterRender render = new RasterRender();
         pListRamp = style.pListRamp;
         render.RasterClassify(rasterlayer, cmbClassifyMethod.SelectedItem.ToString(), Convert.ToInt32(cmbClassifyCount.SelectedItem), (IColorRamp)pListRamp[cmbSymClassify.SelectedIndex]);
         //axmapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
         axmapcontrol.Refresh();
         axtoccontrol.Update();
         axmapcontrol.Extent = rasterlayer.AreaOfInterest;
     }
     catch (Exception ec)
     {
         MessageBox.Show(ec.Message);
     }
 }
コード例 #2
0
        private void btnRasterOK_Click(object sender, EventArgs e)
        {
            switch (tabControl1.SelectedIndex)
            {
            case 0:
                try
                {
                    IRasterStretchColorRampRenderer rasStreRen = new RasterStretchColorRampRendererClass();
                    IRasterRenderer rasRen = rasStreRen as IRasterRenderer;
                    rasRen.Raster = rasterlayer.Raster;
                    rasRen.Update();
                    rasStreRen.BandIndex = cmbBand.SelectedIndex;
                    pListRamp            = style.pListRamp;
                    rasStreRen.ColorRamp = (IColorRamp)pListRamp[cmbsymRaster.SelectedIndex];
                    rasRen.Update();
                    rasterlayer.Renderer = rasStreRen as IRasterRenderer;
                    IRasterStretch2 stretch = rasStreRen as IRasterStretch2;
                    stretch.BackgroundValue = 0;
                    stretch.Background      = true;
                    stretch.BackgroundColor = RasterRender.GET(255, 255, 255) as IColor;
                    axmapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                    axtoccontrol.Update();
                    axmapcontrol.Extent = rasterlayer.AreaOfInterest;
                    this.Close();
                }
                catch (Exception ec)
                {
                    MessageBox.Show(ec.Message);
                }
                break;

            case 1:
                RasterRender render = new RasterRender();
                pListRamp = style.pListRamp;
                render.RasterClassify(rasterlayer, cmbClassifyMethod.SelectedValue.ToString(), Convert.ToInt32(cmbClassifyCount.SelectedValue), (IColorRamp)pListRamp[cmbSymClassify.SelectedIndex]);
                axmapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                axtoccontrol.Update();
                axmapcontrol.Extent = rasterlayer.AreaOfInterest;
                break;
            }
        }