Building and rendering a bitmap from a double array
- by Ami
I'm new to c# and I'm sure I'm missing something simple here.
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.
Bitmap bmp = new Bitmap(image_width, image_height);
Color pxl_color = new Color();
for (int i = 0; i < image_width; i++)
{
for (int j = 0; j < image_height; j++)
{
pxl_color = Color.FromArgb(array_bitmap[i][j]);
bmp.SetPixel(i, j, pxl_color);
}
}
PictureBox1.Image = bmp;
Thanks in advance.