This document is archived and information here might be outdated. Recommended version. |
Provides access to min/max members which control contrast stretching.
Name | Description | |
---|---|---|
CustomStretchMax | The custom maximum value for stretch renderer type "Minimum-Maximum". | |
CustomStretchMin | The custom minimum value for stretch renderer type "Minimum-Maximum". | |
StretchMax | The maximum value used for stretching cell values. | |
StretchMin | The minimum value used for stretching cell values. | |
UseCustomStretchMinMax | Indicates whether to use the custom minimum/maximum values for stretch renderer type "Minimum-Maximum". |
Classes | Description |
---|---|
RasterStretchColorRampRenderer | A renderer with a color ramp for rasters with continuous values. |
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.
//--------------------------------------------
// 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();
}
'--------------------------------------------
' 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