开发者

Converting and displaying a byte array as an image in a datagrid [duplicate]

开发者 https://www.devze.com 2023-03-07 19:49 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: how to display converted byte array as image in datagrid
This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

how to display converted byte array as image in datagrid

I have inserted images into a sql database. I want to display these images in a datagrid. Currently in my datagrid, I just have a image col开发者_如何学Goumn and each cell in that column just says Byte[]Array. So i need to convert these byte arrays back to an image and then display these images in the datagrid. I am drawing a blank as to how to do this. any help is appreciated. Thanks


You will probably need to inherit from DataGridViewCell and create you own that can convert the byte array to a Bitmap and draw it on herself.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.aspx

Then with this sample here you'll learn how to use it on your datagrid.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消