HOW TO
The script in this article changes the no-data cells of a single-band image to transparent. If your image is multiband, double-click the image in the table of contents and select the single-band radio button.
Code:
'-- This script expects the view as the active doc and
'-- your image theme as the first theme in the TOC
theView = av.getactivedoc
'-- Get the image theme from the View
theItheme = theView.Getthemes.get(0)
'-- Get the colormap for that image's legend
thelegend = theItheme.getlegend
theColormap = theLegend.Getcolormap
'-- Make the color for the no data value transparent
thenewColor = Color.Make
theNewColor.SetTransparent(true)
theColormap.SetNull(theNewColor)
'-- Reflect the changes in the Legend
theItheme.UpdateLegend
theItheme.Invalidatelegend
Note:
To reverse the effects of this script, double-click the image and click default in the legend window.
Article ID:000003607
Get help from ArcGIS experts
Download the Esri Support App