开发者

Gridview image gallery from binary data images

开发者 https://www.devze.com 2022-12-08 09:22 出处:网络
I have some images stored in varbinary fields. I want get them into a List object e.g List list From here I can access each image byte array, e.g image.ImageData.

I have some images stored in varbinary fields. I want get them into a List object e.g List list

From here I can access each image byte array, e.g image.ImageData.

I need to bind them somehow as thumbnails to asp:gridview or something similar, is it possible开发者_StackOverflow中文版 with binary/byte[] images?


I would try a slightly different approach.

Use an HTTPHandler to retrieve the images and bind the image src to the handler

Embed something like this in your gridview:

<img src="http://www.yoursite.com/imageHandler.ashx?id=4" />

See this StackOverflow answer for how to write the handler: Create PNG image with C# HttpHandler webservice

0

精彩评论

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