Gets the number of bands that make up 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 int BandCount { get; }
Visual Basic (Declaration)
Public ReadOnly Property BandCount As Integer

Field Value

The number of 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