I am trying to apply a RenderingRule using a Colormap to switch my imagery display from color to greyscale (print preview for people without color printers). Here is my code snippet from the button handler that handles the switch:
[INDENT] private void Button1_Click(object sender, RoutedEventArgs e)
{
[INDENT] ArcGISImageServiceLayer lyr = (ArcGISImageServiceLayer)(MyMap.Layers[0]);
RenderingRule rule = new RenderingRule();
rule.VariableName = "Raster";
rule.RasterFunctionName = "Colormap";
Dictionary<string, object> parms = new Dictionary<string, object>();
parms.Add("ColormapName", "Gray");
lyr.RenderingRule = rule;
lyr.Refresh();
[/INDENT] }
[/INDENT]
The code runs fine, but when the imagery layer refreshes instead of displaying in greyscale it just disappears altogether.
Ideas?