AnsweredAssumed Answered

Proper use of ConstructMarkerFromBitmapSource

Question asked by mattrjackson on Jun 29, 2019
Latest reply on Jun 30, 2019 by mattrjackson

Good Evening,


I am trying to use ConstructMarkerFromBitmapSource in v2.3 of the SDK with a CIMUniqueValueRenderer to generate symbology for a series of point features. When I do so, I am getting rather cryptic COM exceptions.  Below is a snippet that results in a COM exception when applying to a feature class. Any ideas?






var r = new CIMUniqueValueRenderer
    Fields = new string[] { "type" }
//r.Groups = new CIMUniqueValueGroup[] { IncidentGroup() };
var uri = new Uri("pack://application:,,,/SamplePlugin;component/Images/blue_circle-16.png");
var img = new BitmapImage(uri);
var marker = SymbolFactory.Instance.ConstructMarkerFromBitmapSource(img) ;
var symbol = SymbolFactory.Instance.ConstructPointSymbol(marker);
r.UseDefaultSymbol = true;
r.DefaultSymbol = symbol.MakeSymbolReference();