ThinkGeo.com    |     Documentation    |     Premium Support

BlinkingOverlay issue

Hi,
I am applying blinking effect to Feature Label(BlinkingTextStyle). it’s working fine.
But while trying to close the application. it’s closing whole project.

Error Message:

Code:
BlinkingTextStyle blinkingTextStyle = new BlinkingTextStyle();
blinkingTextStyle.FillBrushes.Add(GeoBrushes.Red);
blinkingTextStyle.FillBrushes.Add(new GeoSolidBrush(GeoColor.FromArgb(0, 255, 255, 255)));
blinkingTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
blinkingTextStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
imBlinkAircraft.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(blinkingTextStyle);

imBlinkAircraft.DrawingMarginPercentage = 50;
imBlinkAircraft.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

                            LayerOverlay blinkingOverlay = new LayerOverlay() { AutoRefreshInterval = TimeSpan.FromMilliseconds(200) };
                            blinkingOverlay.Layers.Add("BlinkAircraftLayer", imBlinkAircraft);
                            wfMap.Overlays.Add("BlinkAircraftOverlay", blinkingOverlay);

wfMap.OverlaysDrawing += wfMap_OverlaysDrawing;
wfMap.OverlaysDrawn += wfMap_OverlaysDrawn;

public class BlinkingTextStyle : TextStyle
{
private Collection candidates =new Collection();
protected override void DrawCore(IEnumerable features, GeoCanvas canvas, System.Collections.ObjectModel.Collection labelsInThisLayer, System.Collections.ObjectModel.Collection labelsInAllLayers)
{
foreach (var feature in features)
{
if (feature.ColumnValues[“BlinkONOFF”].ToString() == “ON”)
canvas.DrawText(feature.ColumnValues[“AircraftIconType”].ToString(), new GeoFont(“Aircraft_b”, (float)Convert.ToDouble(feature.ColumnValues[“AircraftFontSize”].ToString()), DrawingFontStyles.Regular), GetFillBrush(), new GeoPen(GeoColor.FromArgb(0, 255, 255, 255)), new Collection { ExtentHelper.ToScreenCoordinate(canvas.CurrentWorldExtent, (PointShape)feature.GetShape(), canvas.Width, canvas.Height) }, DrawingLevel, 0, 0, (float)Convert.ToDouble(feature.ColumnValues[“HDirection”].ToString()));
}
}

    public Collection<GeoBrush> FillBrushes
    {
        get { return candidates; }
    }

    private GeoBrush GetFillBrush()
    {
        Random random = new Random();
        int index = random.Next(candidates.Count);

        return candidates[index];
    }
}

Even though while closing application event, i am disable Map drawn events.
private void frmHSDPlotNew_FormClosing(object sender, FormClosingEventArgs e)
{
wfMap.OverlaysDrawing -= wfMap_OverlaysDrawing;
wfMap.OverlaysDrawn -= wfMap_OverlaysDrawn;
}

Please suggest me, what actually problem and how can we resolve it.

Thanks,
Riyaz

Hi Riyaz,

Thanks for let us know your question.

Here I build a sample but it looks application hadn’t get crash when close.

8849.zip (103.0 KB)

Please modify it to let us reproduce your problem.

Regards,

Ethan

Hi Ethan,
Thanks, it’s resolved.

Riyaz

Hi Riyaz,

I am glad to hear that solved.

Regards,

Ethan

Hi Ethan,
I got one more issue regarding blink.
Some times Blink not happening.it’s basing zoom level and Blink On/Off.

Sample:
1.zip (1.7 KB)

Thanks,
Riyaz

Hi Riyaz,

Could you please build a sample or modify our sample to reproduce it? Because we also need the other information for example what’s the version you are using.

Regards,

Ethan