日期:2014-05-17 浏览次数:21093 次
if (dataGridViewX1.Rows.Count == 0
------解决方案--------------------
dataGridViewX1.Columns.Count == 0
------解决方案--------------------
dataGridViewX1.CurrentCell.RowIndex == -1
------解决方案--------------------
dataGridViewX1.CurrentCell.ColumnIndex == -1)
return;
int index = dataGridViewX1.CurrentCell.RowIndex;
byte[] imagedata = (byte[])(dataGridViewX1.Rows[index].Cells[3].Value);
MemoryStream myStream = new MemoryStream();
foreach(byte a in imagedata )
{
myStream.WriteByte(a);
}
Image myimage = Image.FromStream(myStream);
myStream.Close();
this.pictureBox1.Image = myimage;
this.pictureBox1.Refresh();