将对象转换为图像

时间:2020-04-19 10:30:28

标签: c# .net image object

StudentPicture.BackgroundImage = dataGridView1.CurrentRow.Cells["studentPictureDataGridViewImageColumn"].Value;

如何将对象转换为图像?

1 个答案:

答案 0 :(得分:-1)

尝试将您的对象转换为字节数组。然后使用MemoryStream将字节数组转换为Image。

引用this帖子

byte[] yourImage;
MemoryStream ms = new MemoryStream(image);
Image.FromStream(ms);