地图图元的闪烁效果制作
实现查找之后如果加上一个闪烁效果会更明显,方法是用个时间控件控制,改变vstyle即可;
还可以简单的设置进程休眠时间,改变可视性,利用一个循环,控制闪烁次数。
前面一种实现代码如下:
用个时间控件控制,改变vstyle
FeatureLayer fl = this.mapControl1.Map.Layers["pathLine"] as FeatureLayer;
FeatureOverrideStyleModifier fsm2 = new FeatureOverrideStyleModifier("fsm2", "fsm2", new MapInfo.Styles.CompositeStyle(new MapInfo.Styles.AreaStyle(new MapInfo.Styles.SimpleLineStyle(new MapInfo.Styles.LineWidth(3, MapInfo.Styles.LineWidthUnit.Pixel), 2, System.Drawing.Color.Purple), new MapInfo.Styles.SimpleInterior(2, System.Drawing.Color.Yellow))));
//Removes the old modifier
fl.Modifiers.Remove("fsm1");
//Adds the new modifier
fl.Modifiers.Append(fsm2);
FeatureLayer fl = this.mapControl1.Map.Layers["pathLine"] as FeatureLayer;
FeatureOverrideStyleModifier fsm2 = new FeatureOverrideStyleModifier("fsm2", "fsm2", new MapInfo.Styles.CompositeStyle(new MapInfo.Styles.AreaStyle(new MapInfo.Styles.SimpleLineStyle(new MapInfo.Styles.LineWidth(3, MapInfo.Styles.LineWidthUnit.Pixel), 2, System.Drawing.Color.Purple), new MapInfo.Styles.SimpleInterior(2, System.Drawing.Color.Yellow))));
//Removes the old modifier
fl.Modifiers.Remove("fsm1");
//Adds the new modifier
fl.Modifiers.Append(fsm2);