title: C# convert a 2D double array to and greyscale image
body: <p>first time working with C# here. I am reading a few images files, do some calculations, and output and array of double. I need to be able to save this double array (or these, since I will have multiples arrays) to a greyscale image. I have been looking around on the internet, I couldn't find much. i have done it on Python and Mathlab, but C# doesn't seems to be as friendly to me. here is what I have done so far (for the double image creation).</p>
  
  <pre><code>        static Image MakeImage(double[,] data)
      {
          Image img = new Bitmap(data.GetUpperBound(1), data.GetUpperBound(0));
          //Bitmap bitmap = new Bitmap(data.GetUpperBound(1), data.GetUpperBound(0));
          for (int i = 0; i &lt; data.GetUpperBound(1); i++)
          {
              for (int k = 0; k &lt; data.GetUpperBound(0); k++)
              {
                  //bitmap.SetPixel(k, i, Color.FromArgb((int)data[i, k],(int) data[i, k],(int) data[i, k]));
              }
          }
  
          return img;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This code actually doesnt do much. It create my blank image template. color doesnt take double as input. I have no Idea how to create an image from data... I am stuck =)</p>
  
  <p>thank you in advance.</p>