Gets a collection consisting of all the band names in the Raster.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public ReadOnlyCollection<string> GetBandNames()
Visual Basic (Declaration)
Public Function GetBandNames As ReadOnlyCollection(Of String)

Return Value

A ReadOnlyCollection object consisting of the names of all the bands.

Examples

The code below opens a file geodatabase raster using the OpenFileGeodatabaseRaster method, then returns a count of the constituent raster bands and prints out their names.
CopyC#
{
  //Open file geodatabase raster
  Raster mtnRaster = Raster.OpenFileGeodatabaseRaster(@"C:\Data\Scotland.gdb", "SOUTHGORMS_HO");

  //Find out how many bands the raster is composed of
  int bandCount = mtnRaster.BandCount;

  //Print out the raster band names
  foreach (string bandName in mtnRaster.GetBandNames())
  {
    System.Diagnostics.Debug.Print(bandName);
  }      
}
CopyVB.NET
'Open a file geodatabase raster
Dim mtnRaster As Raster = Raster.OpenFileGeodatabaseRaster("C:\Data\Scotland.gdb", "SOUTHGORMS_HO")

'Print the name of the raster
System.Diagnostics.Debug.Print(mtnRaster.Name)       'Prints "SOUTHGORMS_HO"


'Find out how many bands the raster is composed of
Dim bandCount As Integer = mtnRaster.BandCount

'Print out the raster band names
For Each bandName As String In mtnRaster.GetBandNames()
  System.Diagnostics.Debug.Print(bandName)
Next

See Also