(.NET) rasterlayer nodata value in axmapcontrol

409
2
04-15-2011 12:13 PM
SébastienGagnon
New Contributor
Hi!

I'm looking for a code in .net that take a rasterlayer (.tiff) and display it in my mapcontrol with transparency where is no data value. I know i can add it to my mapcontrol with this code

Dim pRasterly1 As IRasterLayer
        pRasterly1 = New RasterLayer

        pRasterly1.CreateFromFilePath()

But how can i change the black background of raster (no data value) to transparency?

Thanks
0 Kudos
2 Replies
TimParis
New Contributor
0 Kudos
SébastienGagnon
New Contributor
Thank you! This solved my problem!In Arcmap i created a new layergroup add my rasters and save as layer file. For code i simply used:

Me.axmapcontrol1.addlayerfromfile(" ")

No more black background!
0 Kudos