Pitney Bowes MapXtreme User Manual
Page 281

Chapter 14: Using Themes and Legends
Creating an IndividualValueTheme with Custom Bitmap Symbols
MapXtreme v7.1
288
Developer Guide
Creating an IndividualValueTheme with Custom Bitmap Symbols
The following C# example shows how to create an IndividualValueTheme that use custom bitmap
symbols. A table of available bitmap symbols is included in
// Open a connection to the Catalog
MapInfo.Data.MIConnection conn = new MapInfo.Data.MIConnection();
conn.Open();
// Retrieve a table from the Catalog
MapInfo.Data.Table ti=conn.Catalog.GetTable("usa_caps");
// Add it as a layer to MapControl
MapInfo.Mapping.FeatureLayer fl=mapControl1.Map.Layers["usa_caps"] _
as FeatureLayer ;
// Create a new IndividualValueTheme
MapInfo.Mapping.Thematics.IndividualValueTheme iv=new _
MapInfo.Mapping.Thematics.IndividualValueTheme(fl,"state","state");
// Add a custom bitmap symbol
MapInfo.Styles.BitmapPointStyle bitmappointstyle = new _
MapInfo.Styles.BitmapPointStyle("AMBU1-32.BMP", _
MapInfo.Styles.BitmapStyles.All ,System.Drawing.Color.Red , 30);
// Set the style
MapInfo.Styles.CompositeStyle cs = new _
MapInfo.Styles.CompositeStyle(null, null, null, bitmappointstyle);
// Apply the style to the first bin
MapInfo.Mapping.Thematics.ModifierThemeBin mtb= iv.Bins[0];
mtb.Style.ApplyStyle(cs);
// Add another bitmap symbol
bitmappointstyle = new _MapInfo.Styles.BitmapPointStyle("BADG1-32.BMP", _
MapInfo.Styles.BitmapStyles.All ,System.Drawing.Color.Red , 30);
// Set the style
cs=new MapInfo.Styles.CompositeStyle(null, null, null, _
bitmappointstyle);
// Apply the symbol to the second bin
mtb= iv.Bins[1];
mtb.Style.ApplyStyle(cs);
// Append the style modifiers to the feature layer
fl.Modifiers.Append (iv);
//Close the connection
conn.Close();