int[] bandindex = new int[(dataset as DatasetImage).BandCount];
double noData = 256;
// 获取图层无值
for (int i = 0; i < (dataset as DatasetImage).BandCount; i++)
{
bandindex[i] = i;
noData *= dataset.GetNoData(i);
}
//设置风格并添加数据集
//Set the style and add the point dataset
LayerSettingImage setting = new LayerSettingImage();
setting.IsSpecialValueTransparent = true;
setting.DisplayMode = ImageDisplayMode.Composite;
setting.DisplayColorSpace = ColorSpaceType.RGB;
setting.DisplayBandIndexes = bandindex;
setting.SpecialValue = noData;
return layers.Add(dataset, setting, true);
上面是添加影像数据集到图层的代码,设置无值属性的值是double类型,但无值信息是每个波段都有,应该怎么样才能正常获取并设置呢?