从二进制数据图像gridview的图片库 [英] Gridview image gallery from binary data images
问题描述
我在存储领域VARBINARY一些图像。我希望让他们进入一个List对象名单例如列表
I have some images stored in varbinary fields. I want get them into a List object e.g List list
在这里,我可以访问每个图像的字节数组,例如image.ImageData。
From here I can access each image byte array, e.g image.ImageData.
我需要以某种方式将它们绑定为缩略图ASP:GridView的或类似的东西,是有可能与二进制/字节[]图像
I need to bind them somehow as thumbnails to asp:gridview or something similar, is it possible with binary/byte[] images?
推荐答案
我想尝试一个稍微不同的方法。
I would try a slightly different approach.
使用一个HttpHandler来检索图像和图片src结合到处理
Use an HTTPHandler to retrieve the images and bind the image src to the handler
嵌入这样的事情在你的GridView:
Embed something like this in your gridview:
<img src="http://www.yoursite.com/imageHandler.ashx?id=4" />
看到这个计算器的答案怎么写的处理程序:
<一href=\"http://stackoverflow.com/questions/887985/create-png-image-with-c-httphandler-webservice\">http://stackoverflow.com/questions/887985/create-png-image-with-c-httphandler-webservice
这篇关于从二进制数据图像gridview的图片库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!