private IEnumerable <ValuedPoint> CalcColoredPoints()
        {
            var palette = new GridPalette(Colors, MinValue, MaxValue);

            return(grid.Nodes.Select(node => new ValuedPoint(node)
            {
                Style = new Style
                {
                    Brush = new SolidBrush(palette.GetColor(node.Z)),
                    Symbol = new Symbol
                    {
                        Font = new Font("Webdings", 7)
                    }
                }
            }));
        }
示例#2
0
        private Bitmap CalcBitmap()
        {
            var width     = grid.ColumnCount;
            var height    = grid.RowCount;
            var newBitmap = new Bitmap(width, height);

            var palette = new GridPalette(Colors, MinValue, MaxValue);

            for (int i = 0; i < height; i++)
            {
                for (int j = 0; j < width; j++)
                {
                    double?value = grid[i, j];
                    var    color = value.HasValue ? palette.GetColor(value.Value) : nullColor;
                    newBitmap.SetPixel(j, i, color);
                }
            }

            return(newBitmap);
        }