我需要一些帮助来检索存储在 posgresql 数据库列中的图像 [二进制数据] 并将其显示在 C# 中的图片框中。我使用 MemoryStream 插入它。
谢谢!
答案 0 :(得分:0)
我找到了解决方案。
byte[] imgdata = (byte[])dataGridView1.CurrentRow.Cells[1].Value;
MemoryStream ms = new MemoryStream(imgdata);
pictureBox.Image = Image.FromStream(ms);
感谢 jdweng 发表评论。