public MapInfo.Styles.CompositeStyle GetOpaquesStyle(bool opaqueType, System.Drawing.Color borderColor)
{
MapInfo.Styles.SimpleInterior simpleInterior;
if (opaqueType)
simpleInterior = new MapInfo.Styles.SimpleInterior(); //缺省构造函数是白色实心
else
{
simpleInterior = new MapInfo.Styles.SimpleInterior(2); //2是面透明
}
MapInfo.Styles.LineWidth lineWidth = new MapInfo.Styles.LineWidth(1, MapInfo.Styles.LineWidthUnit.Point);
MapInfo.Styles.SimpleLineStyle simpleLineStyle;
if (opaqueType)
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth);
else if (!opaqueType)
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth, 2, borderColor); //2表示填充//透明,即能够显示轮廓
else
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth, 0); //0表示全部透明,即连轮
//廓都看不到
MapInfo.Styles.AreaStyle areaStyle = new MapInfo.Styles.AreaStyle(simpleLineStyle, simpleInterior);
simpleInterior.BackColor = borderColor;
simpleInterior.ForeColor = borderColor;
MapInfo.Styles.CompositeStyle compositeStyle = new MapInfo.Styles.CompositeStyle(areaStyle, null, null, null);
return compositeStyle;
}
{
MapInfo.Styles.SimpleInterior simpleInterior;
if (opaqueType)
simpleInterior = new MapInfo.Styles.SimpleInterior(); //缺省构造函数是白色实心
else
{
simpleInterior = new MapInfo.Styles.SimpleInterior(2); //2是面透明
}
MapInfo.Styles.LineWidth lineWidth = new MapInfo.Styles.LineWidth(1, MapInfo.Styles.LineWidthUnit.Point);
MapInfo.Styles.SimpleLineStyle simpleLineStyle;
if (opaqueType)
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth);
else if (!opaqueType)
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth, 2, borderColor); //2表示填充//透明,即能够显示轮廓
else
simpleLineStyle = new MapInfo.Styles.SimpleLineStyle(lineWidth, 0); //0表示全部透明,即连轮
//廓都看不到
MapInfo.Styles.AreaStyle areaStyle = new MapInfo.Styles.AreaStyle(simpleLineStyle, simpleInterior);
simpleInterior.BackColor = borderColor;
simpleInterior.ForeColor = borderColor;
MapInfo.Styles.CompositeStyle compositeStyle = new MapInfo.Styles.CompositeStyle(areaStyle, null, null, null);
return compositeStyle;
}