private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 1) //第一列是 ID (隐藏),第二列才是图片(Pic)列
{
int rowIndex = this.dataGridView1.CurrentRow.Index; // 取得当前单元格的行Index
string pic = dataGridView1.Rows[rowIndex].Cells["Pic"].Value.ToString();
byte[] str = Convert.FromBase64String(pic);
Image image = GetImage(str);
this.pictureBox1.Image = image;
}
来源:CSDN
作者:qq_43519117
链接:https://blog.csdn.net/qq_43519117/article/details/104348751