This document is archived and information here might be outdated.  Recommended version.


IRasterStretchMinMax Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IR > IRasterStretchMinMax Interface
ArcGIS Developer Help

IRasterStretchMinMax Interface

Provides access to min/max members which control contrast stretching.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Name Description
Read/write property CustomStretchMax The custom maximum value for stretch renderer type "Minimum-Maximum".
Read/write property CustomStretchMin The custom minimum value for stretch renderer type "Minimum-Maximum".
Read-only property StretchMax The maximum value used for stretching cell values.
Read-only property StretchMin The minimum value used for stretching cell values.
Read/write property UseCustomStretchMinMax Indicates whether to use the custom minimum/maximum values for stretch renderer type "Minimum-Maximum".

Classes that implement IRasterStretchMinMax

Classes Description
RasterStretchColorRampRenderer A renderer with a color ramp for rasters with continuous values.

Remarks

The IRasterStretchMinMax interface allows specification of custom minimum and maximum values when rendering a raster band using a linear stretch. This interface is useful when multiple images need to be displayed with same stretch.

[C#]

//--------------------------------------------
// This sample will assign a raster stretch
// renderer with a custom min/max range.
// Before running add "demo30" from ArcTutor.
// <ArcTutor>/Catalog/YellowStone/dem30
//--------------------------------------------

        public void TestRasterStretchColorRampRen(IApplication pApp)
        {
            IRasterStretchColorRampRenderer pRasterStretchColorRampRenderer;
            pRasterStretchColorRampRenderer = new RasterStretchColorRampRendererClass();
            pRasterStretchColorRampRenderer.ColorScheme = "Temperature";
            //
            IRasterStretch pRasterStretch;
            pRasterStretch = (IRasterStretch) pRasterStretchColorRampRenderer;
            pRasterStretch.StretchType = esriRasterStretchTypesEnum.esriRasterStretch_MinimumMaximum;
            //
            IRasterStretchMinMax pRasterStretchMinMax;
            pRasterStretchMinMax = (IRasterStretchMinMax)pRasterStretchColorRampRenderer;
            pRasterStretchMinMax.UseCustomStretchMinMax = true;
            pRasterStretchMinMax.CustomStretchMin = 2500;
            pRasterStretchMinMax.CustomStretchMax = 3447;
            //
            IMxDocument pMxDocument;
            pMxDocument = (IMxDocument)pApp.Document;
            //
            ILayer pLayer;
            pLayer = pMxDocument.FocusMap.get_Layer(0);
            //
            IRasterLayer pRasterLayer;
            pRasterLayer = (IRasterLayer)pLayer;
            pRasterLayer.Renderer = (IRasterRenderer)pRasterStretchColorRampRenderer;
            //
            pMxDocument.UpdateContents();
            //
            IActiveView pActiveView;
            pActiveView = (IActiveView)pMxDocument.FocusMap;
            pActiveView.Refresh();
        }
[Visual Basic .NET]

'--------------------------------------------
' This sample will assign a raster stretch
' renderer with a custom min/max range.
' Before running add "demo30" from ArcTutor.
' <ArcTutor>/Catalog/YellowStone/dem30
'--------------------------------------------

Public Sub TestRasterStretchColorRampRen(ByVal pApp As IApplication)
        Dim pRasterStretchColorRampRenderer As IRasterStretchColorRampRenderer
        pRasterStretchColorRampRenderer = New RasterStretchColorRampRendererClass
        pRasterStretchColorRampRenderer.ColorScheme = "Temperature"
        '
        Dim pRasterStretch As IRasterStretch
        pRasterStretch = pRasterStretchColorRampRenderer
        pRasterStretch.StretchType = esriRasterStretchTypesEnum.esriRasterStretch_MinimumMaximum
        '
        Dim pRasterStretchMinMax As IRasterStretchMinMax
        pRasterStretchMinMax = pRasterStretchColorRampRenderer
        pRasterStretchMinMax.UseCustomStretchMinMax = True
        pRasterStretchMinMax.CustomStretchMin = 2500
        pRasterStretchMinMax.CustomStretchMax = 3447
        '
        Dim pMxDocument As IMxDocument
        pMxDocument = pApp.Document
        '
        Dim pLayer As ILayer
        pLayer = pMxDocument.FocusMap.Layer(0)
        '
        Dim pRasterLayer As IRasterLayer
        pRasterLayer = pLayer
        pRasterLayer.Renderer = pRasterStretchColorRampRenderer
        '
        pMxDocument.UpdateContents()
        '
        Dim pActiveView As IActiveView
        pActiveView = pMxDocument.FocusMap
        pActiveView.Refresh()
End Sub

See Also

RasterStretchColorRampRenderer Class