Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
898 views
in Technique[技术] by (71.8m points)

c# - How to convert byte array to image and display in datagrid?

I have made a sql database using sql server. This database include images. When I display this database in a datagrid, byte[]array displays in the image column. How do I convert from a byte array back to an image and then display that image in the datagrid? Any help or tutorials are appreciated. thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try

 MemoryStream ms = new MemoryStream(imageBytes);
 Image image= Image.FromStream(ms);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...