<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use RenderingRule with Colormap to display imagery in greyscale in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152626#M3844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your dictionary of parameters looks initialized but never used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Feb 2011 18:35:38 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2011-02-10T18:35:38Z</dc:date>
    <item>
      <title>How to use RenderingRule with Colormap to display imagery in greyscale</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152625#M3843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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).&amp;nbsp; Here is my code snippet from the button handler that handles the switch:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Button1_Click(object sender, RoutedEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISImageServiceLayer lyr = (ArcGISImageServiceLayer)(MyMap.Layers[0]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RenderingRule rule = new RenderingRule();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rule.VariableName = "Raster";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rule.RasterFunctionName = "Colormap";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dictionary&amp;lt;string, object&amp;gt; parms = new Dictionary&amp;lt;string, object&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parms.Add("ColormapName", "Gray");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.RenderingRule = rule;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.Refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code runs fine, but when the imagery layer refreshes instead of displaying in greyscale it just disappears altogether.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 17:27:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152625#M3843</guid>
      <dc:creator>BobbyRadakovich</dc:creator>
      <dc:date>2011-02-10T17:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use RenderingRule with Colormap to display imagery in greyscale</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152626#M3844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your dictionary of parameters looks initialized but never used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 18:35:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152626#M3844</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-02-10T18:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use RenderingRule with Colormap to display imagery in greyscale</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152627#M3845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void Button1_Click(object sender, RoutedEventArgs e)
{
ArcGISImageServiceLayer lyr = (ArcGISImageServiceLayer)(MyMap.Layers[0]);
&lt;STRONG&gt;

// Make sure when you are applying rendering rule that you are only 
// using a single color band id. Layer may have multiple color bands.
// You have to select a single color band id to convert to grayscale.

lry.BandIds = new int[] { bandID }; &lt;/STRONG&gt;
RenderingRule rule = new RenderingRule();
rule.VariableName = "Raster";
rule.RasterFunctionName = "Colormap";
Dictionary&amp;lt;string, object&amp;gt; parms = new Dictionary&amp;lt;string, object&amp;gt;();
parms.Add("ColormapName", "Gray");
&lt;STRONG&gt;rule.RasterFunctionArguments = parms; // Missing this line&lt;/STRONG&gt;
lyr.RenderingRule = rule;
lyr.Refresh();
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-renderingrule-with-colormap-to-display/m-p/152627#M3845</guid>
      <dc:creator>ChristopherHill</dc:creator>
      <dc:date>2021-12-11T08:11:02Z</dc:date>
    </item>
  </channel>
</rss>

