This old thread may help? http://forums.esri.com/Thread.asp?c=93&f=993&t=77571Looks like it was figured out here... http://forums.esri.com/Thread.asp?c=93&f=992&t=77921This is old code, not my code, I have not tested it, it's from the old forum post above... hope that helps...'----------------change to stretched layer------------------------- Dim pStretchedRenderer As IRasterStretchColorRampRenderer Dim pRasterRendereer As IRasterRenderer Dim pRasterStretch As IRasterStretch Set pStretchedRenderer = New RasterStretchColorRampRenderer Set pRasterRendereer = pStretchedRenderer Set pRasterRendereer.Raster = pRLyr.Raster Set pRasterStretch = pStretchedRenderer pRasterStretch.BackgroundValues = 0 pRasterStretch.Background = True Set pRLyr.Renderer = pStretchedRenderer pRLyr.Renderer.Update Set pStretchedRenderer = Nothing Set pRasterRendereer = Nothing'----------------END change to stretched layer---------------------
It looks like what you want to do is change your layer's NoData symbol to No Color. You can do this through the Layer properties -> Symbology tab.
Thank you for your reply!I have tried your method, but i'am sorry to tell you that it's not my want. ILayerEffects.Transparency is used to set the whole ILayer transparency. But how can i just change some specific rgb(such as R0 G0 B0) of raster to transparency? Like this�?Now display�?(have black region)[ATTACH=CONFIG]30242[/ATTACH]I want�?(set R=0 G=0 B=0 transparency)[ATTACH=CONFIG]30243[/ATTACH]Thanks for your help~
Something like this maybe? Dim pApp As IMxApplication = m_application Dim pDoc As IMxDocument = m_application.Document Dim pMap As IMap = pDoc.FocusMap Dim pLayer As ILayer = pMap.Layer(0) 'map index set here Dim pRasterLayer As IRasterLayer = pLayer Dim pLayerEffects As ILayerEffects pLayerEffects = pRasterLayer pLayerEffects.Transparency = 25 'transparceny value set here pDoc.ActiveView.Refresh() pDoc.UpdateContents()sorry but this is vb.net snippet
Layer transparency is a property of the layer object. You can set it using ILayerEffects.
No one reply:(
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.