В VBA это делается вот так.
Public Sub UsingRasterStretchColorRampRender()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap
'Get raster input from layer
Dim pRLayer As IRasterLayer
Set pRLayer = pMap.Layer(0)
Dim pRaster As IRaster
Set pRaster = pRLayer.Raster
'Create renderer and QI RasterRenderer
Dim pStretchRen As IRasterStretchColorRampRenderer
Set pStretchRen = New RasterStretchColorRampRenderer
Dim pRasRen As IRasterRenderer
Set pRasRen = pStretchRen
Dim pRasterStrech As IRasterStretch
Set pRasterStrech = pStretchRen
pRasterStrech.StretchType = esriRasterStretch_MinimumMaximum
Dim pRasterStrechMinMax As IRasterStretchMinMax
Set pRasterStrechMinMax = pStretchRen
pRasterStrechMinMax.CustomStretchMin = 20
pRasterStrechMinMax.CustomStretchMax = 100
pRasterStrechMinMax.UseCustomStretchMinMax = True
'Set raster for the renderer and update
Set pRasRen.Raster = pRaster
pRasRen.Update
'Define two colors
Dim pFromColor As IColor
Dim pToColor As IColor
Set pFromColor = New RgbColor
pFromColor.RGB = RGB(255, 0, 0)
Set pToColor = New RgbColor
pToColor.RGB = RGB(0, 0, 255)
'Create color ramp
Dim pRamp As IAlgorithmicColorRamp
Set pRamp = New AlgorithmicColorRamp
pRamp.size = 255
pRamp.FromColor = pFromColor
pRamp.ToColor = pToColor
pRamp.CreateRamp True
'Plug this colorramp into renderer and select a band
pStretchRen.BandIndex = 0
pStretchRen.ColorRamp = pRamp
pStretchRen.LabelHigh = "100"
pStretchRen.LabelLow = "20"
'Update the renderer with new settings and plug into layer
pRasRen.Update
Set pRLayer.Renderer = pStretchRen
pMxDoc.ActiveView.Refresh
pMxDoc.UpdateContents
'Release memeory
Set pMxDoc = Nothing
Set pRLayer = Nothing
Set pRaster = Nothing
Set pStretchRen = Nothing
Set pRasRen = Nothing
Set pRamp = Nothing
Set pToColor = Nothing
Set pFromColor = Nothing
End Sub