private VectorStyle CalculateVectorStyle(SharpMap.Styles.VectorStyle min, SharpMap.Styles.VectorStyle max, double value)
{
VectorStyle style = new VectorStyle();
double dFrac = Fraction(value);
float fFrac = Convert.ToSingle(dFrac);
style.Enabled = (dFrac>0.5 ? min.Enabled : max.Enabled);
style.EnableOutline = (dFrac>0.5 ? min.EnableOutline : max.EnableOutline);
if (_FillColorBlend != null)
style.Fill = new System.Drawing.SolidBrush(_FillColorBlend.GetColor(fFrac));
else if (min.Fill != null && max.Fill != null)
style.Fill = InterpolateBrush(min.Fill, max.Fill, value);
if (min.Line != null && max.Line != null)
style.Line = InterpolatePen(min.Line, max.Line, value);
if (_LineColorBlend != null)
style.Line.Color = _LineColorBlend.GetColor(fFrac);
if(min.Outline!=null && max.Outline != null)
style.Outline = InterpolatePen(min.Outline, max.Outline,value);
style.MinVisible = InterpolateDouble(min.MinVisible, max.MinVisible, value);
style.MaxVisible = InterpolateDouble(min.MaxVisible, max.MaxVisible, value);
style.Symbol = (dFrac > 0.5 ? min.Symbol : max.Symbol);
style.SymbolOffset = (dFrac > 0.5 ? min.SymbolOffset : max.SymbolOffset); //We don't interpolate the offset but let it follow the symbol instead
style.SymbolScale = InterpolateFloat(min.SymbolScale, max.SymbolScale, value);
return style;
}