I have posted this question on The MapXtreme forum but since nobody ever answers questions there I am hoping someone here has some experience with this product (mapxtreme is a GIS SDK made by the people who make MapInfo)
I am working on a MapXtreme Desktop app and we need bitmaps of our features styles
I have tried two ways but all I get is a grey bitmap with a dark X.
here is the code I have used both ways are in the code but one is commented out:
public static Bitmap GetStyleBitmap(Style style)
{
var bm = new Bitmap(16, 16, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
var rect = new System.Drawing.Rectangle(0, 0, 16, 16);
var ss = new StyleSample();
ss.Bounds = rect;
if (style is CompositeStyle)
{
ss.ApplyAreaStyle(((CompositeStyle)style).AreaStyle);
ss.ApplyLineStyle(((CompositeStyle)style).LineStyle);
}
if (style is AreaStyle)
{
ss.ApplyAreaStyle((AreaStyle)style);
}
if (style is SimpleLineStyle)
{
ss.ApplyLineStyle((SimpleLineStyle)style);
}
//using MapExport
var me = new MapExport(ss.Map);
var image = me.Export();
return new Bitmap(image);
//using StyleSample.DrawToBitmap
//ss.DrawToBitmap(bm, rect);
//return bm;
}
TIA