ThinkGeo.com    |     Documentation    |     Premium Support

Grayscale and transparency

The Desktop 2.0 edition allowed you to set the grayscale and transparency of the image layer. What is the equivalent in Desktop 3.0 edition?


Thanks!



Greg, 
  
   We have thos kind of properties in the 3.x framework and you can find them on any Layer that inherits from RasterLayer.  For example the EcwRasterLayer will have it an all of the other inherited ones.  The code you need is below.  The transparency is a value between 0 and 255 with 0 being totally transparent and 255 being totally opaque.  In the example below it is about half transparent. 
  
             ecwRasterLayer.Transparency = 128; 
             ecwRasterLayer.IsGrayscale = true; 
  
 David

Well, I guess that’s a big “duh” for me! Sorry, I should have dug more deeply into the API before bothering you guys with a trivial question. 
  
 As you’ve pointed out, these are properties of the raster layer. I followed your suggestion and it worked flawlessly. Thanks for the response!

Greg, 
  
   No problem,  I love to hit slow pitches! 
  
 David