GetStyle() public method

Returns the style based on a numeric DataColumn, where style properties are linearly interpolated between max and min values.
public GetStyle ( SharpMap row ) : SharpMap.Styles.IStyle
row SharpMap Feature
return SharpMap.Styles.IStyle
示例#1
0
        public void GetStyleForNoDataValue()
        {
            var minVectorStyle = new VectorStyle { Fill = new SolidBrush(Color.Red) };
            var maxVectorStyle = new VectorStyle { Fill = new SolidBrush(Color.Blue) };
            var theme = new GradientTheme("red to blue", 10.0, 100.123, minVectorStyle, maxVectorStyle, null, null, null)
                {
                    NoDataValues = new List<double> {12.3}
                };

            var result = (VectorStyle)theme.GetStyle(10.0);
            AssertColor(Color.Red, ((SolidBrush)result.Fill).Color); // Expecting SolidBrush
            AssertColor(Color.FromArgb(255, 138,43, 226), result.Line.Color);

            result = (VectorStyle)theme.GetStyle(12.3);
            AssertColor(Color.Transparent, ((SolidBrush)result.Fill).Color); // Expecting SolidBrush
            AssertColor(Color.Transparent, result.Line.Color);
        }