This piece of code might come in handy. I have tried it.
byte[] imagedata = (byte [])dataGridView1[4, dataGridView1.SelectedRows[0].Index].Value;
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(imagedata, 0, imagedata.Length))
{
ms.Write(imagedata, 0, imagedata.Length);
//Set image variable value using memory stream.
image = Image.FromStream(ms, true );
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…