ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMRasterColorizer Class
Members Example

In This Topic
    CIMRasterColorizer Class
    In This Topic
    Represents a raster colorizer.
    Object Model
    CIMRasterColorizer ClassCIMColor Class
    Syntax
    Example
    Update the raster colorizer on a raster layer
    {
        // Get the colorizer from the raster layer.
        //Note: needs to be called on the QueuedTask
        CIMRasterColorizer rasterColorizer = rasterLayer.GetColorizer();
        // Update raster colorizer properties.
        rasterColorizer.Brightness = 10;
        rasterColorizer.Contrast = -5;
        rasterColorizer.ResamplingType = RasterResamplingType.NearestNeighbor;
        // Update the raster layer with the changed colorizer.
        rasterLayer.SetColorizer(rasterColorizer);
    }
    Update the raster colorizer on a mosaic layer
    {
        // Get the image sub-layer from the mosaic layer.
        //Note: needs to be called on the QueuedTask
        ImageMosaicSubLayer mosaicImageSubLayer = mosaicLayer.GetImageLayer();
        // Get the colorizer from the image sub-layer.
        CIMRasterColorizer rasterColorizer = mosaicImageSubLayer.GetColorizer();
        // Update raster colorizer properties.
        rasterColorizer.Brightness = 10;
        rasterColorizer.Contrast = -5;
        rasterColorizer.ResamplingType = RasterResamplingType.NearestNeighbor;
        // Update the image sub-layer with the changed colorizer.
        mosaicImageSubLayer.SetColorizer(rasterColorizer);
    }
    Update the raster colorizer on an image service layer
    {
        // Get the colorizer from the image service layer.
    
        CIMRasterColorizer rasterColorizer = imageServiceLayer.GetColorizer();
        // Update the colorizer properties.
        rasterColorizer.Brightness = 10;
        rasterColorizer.Contrast = -5;
        rasterColorizer.ResamplingType = RasterResamplingType.NearestNeighbor;
        // Update the image service layer with the changed colorizer.
        imageServiceLayer.SetColorizer(rasterColorizer);
    }
    Update the RGB colorizer on an image service layer
    {
        // Get the colorizer from the image service layer.
        //Note: needs to be called on the QueuedTask
        CIMRasterColorizer rColorizer = imageServiceLayer.GetColorizer();
        // Check if the colorizer is an RGB colorizer.
        if (rColorizer is CIMRasterRGBColorizer rasterRGBColorizer)
        {
            // Update RGB colorizer properties.
            rasterRGBColorizer.StretchType = RasterStretchType.ESRI;
            // Update the image service layer with the changed colorizer.
            imageServiceLayer.SetColorizer((CIMRasterColorizer)rasterRGBColorizer);
        }
    }
    Inheritance Hierarchy
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also