Building and rendering a bitmap from a double array
<p>I'm new to c# and I'm sure I'm missing something simple here. </p>

<p>I'm trying to build a bitmap from integer values (0-255) in a double array and then render it in a PictureBox. I think my Bitmap is getting generated but it isn't displaying in my PictureBox.</p>

<pre><code>Bitmap bmp = new Bitmap(image_width, image_height);

Color pxl_color = new Color();

for (int i = 0; i &lt; image_width; i++)
{
    for (int j = 0; j &lt; image_height; j++)
    {
        pxl_color = Color.FromArgb(array_bitmap[i][j]);
        bmp.SetPixel(i, j, pxl_color);
    }
}

PictureBox1.Image = bmp;
</code></pre>

<p>Thanks in advance.</p>

<p><strong>EDIT:</strong></p>

<p>Changing:</p>

<pre><code>pxl_color=Color.FromArgb(array_bitmap[i][j]);
</code></pre>

<p>To:</p>

<pre><code>pxl_color=Color.FromArgb(array_bitmap[i][j],array_bitmap[i][j],array_bitmap[i][j]);
</code></pre>

<p>Solves the problem.</p>
