how to generate heat maps given the points

前端 未结 8 1684
猫巷女王i
猫巷女王i 2021-02-06 07:59

I want to generate a heat map in windows form. I have a set of points as the input. How to go about doing this in the simplest way? Thanks.

8条回答
  •  无人及你
    2021-02-06 08:50

    The C# version of "Curtis White"'s answer:

    public Color HeatMap(decimal value, decimal min, decimal max)
            {
                decimal val = (value - min) / (max - min);
                int A, B, R, G;
                A = 255;
                R = Convert.ToByte(255 * val);
                B = Convert.ToByte(255 * (1 - val));
                G = 0;
                return Color.FromArgb(A, R, G, B);
            }
    

提交回复
热议问题