<?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: Use IRasterShader in add-in button? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/use-irastershader-in-add-in-button/m-p/62478#M1715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's not obvious in the Help which class uses the IRasterShader interface. If you are just tweaking brightness as your snippet suggests you can point ILayerEffects to an IRasterLayer object and set the brightness.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This VBA code shows how to adjust brightness:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMXdoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMXdoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMXdoc.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRasterLayer As IRasterLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRasterLayer = pMap.Layer(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayerEffects As ILayerEffects
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayerEffects = pRasterLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; pLayerEffects.Brightness = 99
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:23:40 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-12-10T22:23:40Z</dc:date>
    <item>
      <title>Use IRasterShader in add-in button?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/use-irastershader-in-add-in-button/m-p/62477#M1714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create an add-in button that programmatically applies contrast, brightness, and gamma to a raster layer.&amp;nbsp; I found the IRasterShader interface in the documentation, but no examples of how to use it.&amp;nbsp; My efforts to use it have not been successful thus far.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now I'm doing something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterLayer rLayer = map.get_Layer(index);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IRasterShader rShader = rLayer as IRasterShader;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rShader.Brightness = brightValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But rShader is null.&amp;nbsp; Does anyone have any insight?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/use-irastershader-in-add-in-button/m-p/62477#M1714</guid>
      <dc:creator>EvanBlaisdell</dc:creator>
      <dc:date>2014-04-28T13:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use IRasterShader in add-in button?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/use-irastershader-in-add-in-button/m-p/62478#M1715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's not obvious in the Help which class uses the IRasterShader interface. If you are just tweaking brightness as your snippet suggests you can point ILayerEffects to an IRasterLayer object and set the brightness.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This VBA code shows how to adjust brightness:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMXdoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMXdoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMXdoc.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRasterLayer As IRasterLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRasterLayer = pMap.Layer(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayerEffects As ILayerEffects
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayerEffects = pRasterLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; pLayerEffects.Brightness = 99
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/use-irastershader-in-add-in-button/m-p/62478#M1715</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-10T22:23:40Z</dc:date>
    </item>
  </channel>
</rss>

