ThinkGeo.com    |     Documentation    |     Premium Support

Label text and mask are not coming correctly ussing CreateMaskTextStyle

Hi,
I am applying mask using CreateMaskTextStyle.

TextStyle tAircraft = new TextStyle();
tAircraft = TextStyles.CreateMaskTextStyle(“AcRegNo”, new GeoFont(“Arial”, 7), new GeoSolidBrush(GeoColor.SimpleColors.Black), new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush(GeoColor.FromArgb(255, 207, 238, 245))), 15, 0);

But it’s coming like that.

I want label should be center of mask(box).
Please suggest how should I solve this issue?

Note: I set 2 things,
wfMap.TextRenderingHint = TextRenderingHint.AntiAlias;
InMemoryFeatureLayer imAircraft = new InMemoryFeatureLayer();
imAircraft.DrawingMarginPercentage = 50;
Please clarify this funtionality may be effect or not.

Thanks,
Riyaz

Hi Riyaz,

As below is my test code, I think your problem should had been fixed, please get our latest 9.0.x.0 dlls for get that.

            TextStyle tAircraft = TextStyles.CreateMaskTextStyle("LONG_NAME", new GeoFont("Arial", 7), new GeoSolidBrush(GeoColor.SimpleColors.Black), new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush(GeoColor.FromArgb(255, 207, 238, 245))), 15, 0);
        winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
        winformsMap1.TextRenderingHint = TextRenderingHint.AntiAlias;            

        ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp");
        worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Green, GeoColor.FromArgb(220, GeoColor.SimpleColors.Green));
        worldLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = tAircraft;
        worldLayer.DrawingMarginPercentage = 50;

        LayerOverlay staticOverlay = new LayerOverlay();
        staticOverlay.Layers.Add("WorldLayer", worldLayer);
        winformsMap1.Overlays.Add(staticOverlay);

        winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2);
        winformsMap1.Refresh();

Regards,

Don