0

I have rasterdataset in gdb. I create layer from this rasterdataset.

    private static void CreateLayer()
    {
        ...
        IRasterLayer rlMosaicDataset = new RasterLayer();
        rlMosaicDataset.CreateFromDataset(rasterDataset);// name in gdb

        IRasterRGBRenderer stretchRenderer = new RasterRGBRenderer();
        IRasterRenderer rasterRenderer = (IRasterRenderer)stretchRenderer;
        IRaster raster = rasterDataset.CreateDefaultRaster();
        rasterRenderer.Raster = raster;
        rasterRenderer.ResamplingType = rstResamplingTypes.RSP_BilinearInterpolation;  // smooth
        rasterRenderer.Update();
        IRasterStretch stretchType = (IRasterStretch)rasterRenderer;
        stretchType.StretchType =
            esriRasterStretchTypesEnum.esriRasterStretch_ESRI;
        stretchType.StandardDeviationsParam = 2; // what is?
        rlMosaicDataset.Renderer = rasterRenderer;

        rlMosaicDataset.MaximumScale = 0.1;
        rlMosaicDataset.MinimumScale = 500000000;
        ...
    }

This layer is black-and-white imagery. I'd like that its color was green and red. (In ArcMap I can do: Layer Properties -> Symbology -> Stretched -> Color Ramp -> here I can choose strip with green, yellow, orange, red colors)

1 Answer 1

2

Here's for a raster classify renderer, includes applying color ramp:

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000267000000

Here's stretch:

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_create_a_raster_stretch_renderer/00010000026w000000/

2
  • Where can I find the explanation of this parameters: stretchType, StandardDeviationsParam and all values?
    – novicegis
    Aug 20, 2013 at 6:39
  • Looking like EDN (Esri Developer Network) might be the only official place. 10.0+ requires a subscription (which you may have depending on your license agreement with Esri). I did a search for the object name and found some 9.3 info: resources.esri.com/help/9.3/arcgisengine/arcobjects/esriCarto/… Can't guarantee it's stayed the same, but it's a start.
    – msayler
    Aug 20, 2013 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.