ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.CIM Namespace / RasterResamplingType Enumeration
Example Example

In This Topic
    RasterResamplingType Enumeration
    In This Topic
    Raster resampling types.
    Syntax
    Members
    MemberDescription
    Average Average.
    BilinearGaussianBlur Bilinear Gaussian blur.
    BilinearGaussianBlurPlus Bilinear Gaussian blur plus.
    BilinearInterpolation Bilinear interpolation.
    BilinearInterpolationPlus Bilinear interpolation plus.
    CubicConvolution Cubic convolution.
    Majority Majority.
    Maximum Maximum.
    Minimum Minimum.
    NearestNeighbor Nearest neighbor.
    VectorAverage Vector average.
    Example
    Update the raster colorizer on a raster layer
    await QueuedTask.Run(() =>
    {
      // Get the colorizer from the raster layer.
      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
    await QueuedTask.Run(() =>
    {
      // Get the image sub-layer from the mosaic layer.
      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
    await QueuedTask.Run(() =>
    {
      // Get the colorizer from the image service layer.
      CIMRasterColorizer rasterColorizer = isLayer.GetColorizer();
      // Update the colorizer properties.
      rasterColorizer.Brightness = 10;
      rasterColorizer.Contrast = -5;
      rasterColorizer.ResamplingType = RasterResamplingType.NearestNeighbor;
      // Update the image service layer with the changed colorizer.
      isLayer.SetColorizer(rasterColorizer);
    });
    Get/Set Raster and Imagery Options
    var ro = ApplicationOptions.RasterImageryOptions;
    
    QueuedTask.Run(() =>
    {
      var validCategories = ro.GetValidColorRampCategories();
      var validCategory = validCategories.FirstOrDefault();
    
      var colorRamps = ColorFactory.Instance.GetColorRampNames(validCategory);
      var newColorRampName = colorRamps.FirstOrDefault();
    
      var stretchedColorRamp = ro.GetStretchedColorRamp();
      var colorRampName = ro.GetStretchedColorRampName();
      ro.SetStretchedColorRampName(null);
    
      var classifyColorRamp = ro.GetClassifyColorRamp();
      colorRampName = ro.GetClassifyColorRampName();
      ro.SetClassifyColorRampName(newColorRampName);
    
      var discreteColorRamp = ro.GetDiscreteColorRamp();
      colorRampName = ro.GetDiscreteColorRampName();
      ro.SetDiscreteColorRampName(newColorRampName);
    
      var uniqueValueColorRamp = ro.GetUniqueValueColorRamp();
      colorRampName = ro.GetUniqueValueColorRampName();
      ro.SetUniqueValueColorRampName(newColorRampName);
    
      var customRendering = ro.GetEnableCustomRenderingDefaults();
      ro.SetEnableCustomRenderingDefaults(!customRendering);
    
      var sampleType = ro.GetResampleType();
      ro.SetResampleType(RasterResamplingType.CubicConvolution);
    
      var stretchType = ro.GetStretchType();
      ro.SetStretchType(RasterStretchType.PercentMinimumMaximum);
    
      var val = ro.GetNumberOfStandardDeviation();
      ro.SetNumberOfStandardDeviation(3);
    
      var (clipMin, clipMax) = ro.GetClipPercentage();
      ro.SetClipPercentage(12, 23);
    
      var red = ro.GetGammaStretchValueRed();
      var green = ro.GetGammaStretchValueGreen();
      var blue = ro.GetGammaStretchValueBlue();
    
      ro.SetGammaStretchValueRed(2);
      ro.SetGammaStretchValueGreen(20);
      ro.SetGammaStretchValueBlue(60);
    
      var displayBackground = ro.GetDisplayBackground();
      ro.SetDisplayBackground(!displayBackground);
    
      var (r, g, b) = ro.GetBackgroundValue();
      ro.SetBackgroundValue(4, 21, 61);
    
      var backColor = ro.GetBackgroundColor();
      ro.SetBackgroundColor(CIMColor.CreateRGBColor(255, 0, 0));
    
      var noData = ro.GetNoDataColor();
      ro.SetNoDataColor(CIMColor.CreateRGBColor(0, 255, 0));
    
    
      // cache
      var useCache = ro.GetUseImageServiceCache();
      ro.SetUseImageServiceCache(!useCache);
    
      //dataset
    
      var opt = ro.GetPyramidOption();
      ro.SetPyramidOption(ArcGIS.Desktop.Core.BuildPyramidOption.NeverBuild);
      var sample = ro.GetPyramidResampleMethod();
      ro.SetPyramidResampleMethod(PyramidResamplingMode.Bilinear);
      var compression = ro.GetPyramidCompressionMethod();
      ro.SetPyramidCompressionMethod(PyramidCompressionType.JPEG_YCbCr);
    
      var quality = ro.GetPyramidCompressionQuality();
      ro.SetPyramidCompressionQuality(32);
    
      var stats = ro.GetStatisticsOption();
      ro.SetStatisticsOption(CalculateStatisticOption.AlwaysCalculate);
      var x = ro.GetSkipFactorX();
      ro.SetSkipFactorX(3);
      var y = ro.GetSkipFactorY();
      ro.SetSkipFactorY(23);
    
      var useWorldFile = ro.GetUseWorldFile();
      ro.SetUseWorldFile(!useWorldFile);
    
      var createTiledTiff = ro.GetCreateTiledTiff();
      ro.SetCreateTiledTiff(!createTiledTiff);
    
      var maxUniqueValues = ro.GetMaximumUniqueValues();
      ro.SetMaximumUniqueValues(123456);
    
      var path = ro.GetProxyFileLocation();
      ro.SetProxyFileLocation("c:\\temp");
    
      var isExpanded = ro.GetIsMosaicLayerExpanded();
      ro.SetIsMosaicLayerExpanded(!isExpanded);
      var isVisible = ro.GetIsMosaicBoundaryVisible();
      ro.SetIsMosaicBoundaryVisible(!isVisible);
      isVisible = ro.GetIsMosaicFootprintVisible();
      ro.SetIsMosaicFootprintVisible(!isVisible);
      isVisible = ro.GetIsMosaicSeamlinesVisible();
      ro.SetIsMosaicSeamlinesVisible(!isVisible);
      isVisible = ro.GetIsMosaicPreviewVisible();
      ro.SetIsMosaicPreviewVisible(!isVisible);
    
      var (red_3band, green_3band, blue_3band) = ro.Get3BandColor();
      ro.Set3BandColor(2, 2, 2);
      var (ms_red, ms_green, ms_blue) = ro.GetMSColor();
      ro.SetMSColor(23, 24, 25);
    
      var enableCustomColorSchemes = ro.GetEnableCustomColorSchemes();
      ro.SetEnableCustomColorSchemes(!enableCustomColorSchemes);
    
      var useWavelengthInfo = ro.GetUseWavelengthInformation();
      ro.SetUseWavelengthInformation(!useWavelengthInfo);
    });
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.CIM.RasterResamplingType

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also