how to generate heat maps given the points

前端 未结 8 1689
猫巷女王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:32

    This is a fix for Sam's code.

      public Color HeatMapColor(decimal value, decimal min, decimal max)
        {
            decimal val = (value - min) / (max - min);
            int r = Convert.ToByte(255 * val);
            int g = Convert.ToByte(255 * (1 - val));
            int b = 0;
    
            return Color.FromArgb(255,r,g,b);                                    
        }
    

提交回复
热议问题