[GIS] How to draw transparent polygons with ArcObjects

arcgis-10.1arcobjectscnettransparency

How do I draw transparent polygons in ArcObjects? I mean is it possible to set alpha channel?

Best Answer

Transparency is not a property of a polygon itself, rather it is a property of the layer containing the polygon (like symbology). Take your polygon data, and store it in an IFeatureLayer. From IFeatureLayer, get ILayerEffects, which is an interface of IFeatureLayer. Transparency (0% to 100%) is a property of ILayerEffects.

Also, note this from ESRI documentation:

When you set Transparency for a FeatureLayer, a TransparencyDisplayFilter is created and applied to the layer. You can accomplish the same effect by manually creating a new TransparencyDisplayFilter using IDisplayFilter, and then assigning it to a layer using IDisplayFilterManager.