我们怎样才能创建SQL图片的灯箱画廊 [英] How can we Create a lightbox gallery with sql images
问题描述
我使用asp.net 4.0和我的所有图像都使用admin CMT存储在数据库中。
I am using asp.net 4.0 and all my images are stored in database using admin CMT.
我想创建一个图片库,以显示在大图的列表和灯箱效果都缩略图。
I want to create a image gallery to display all thumbnail images in a list and lightbox effect for big images.
夹工作正常,如果我们有图象的一个物理位置,但在这种情况下,它是在数据库的二进制数据(图像数据类型)。
lightbox works fine if we have a physical location of the image, but in this case it is binary data (image datatype) in database.
您可以帮我,我怎么能(二进制)图像分配到收藏夹。
Can you help me how can i assign the (binary) image to lightbox.
推荐答案
使用收藏夹从数据库中直接显示图像
Using lightbox for displaying images from database directly
在每个IMG SCR创建一个HTTP处理程序,并调用的处理程序
Create a HTTP handler and called the handler in the in every img scr
<img src="ShowImg.ashx?ID=imageid" alt="imgetitle" />
处理器将从作为查询字符串传递给它的imageid加载图像。在处理程序,我们将右侧的code,从数据库,并显示在页面上读取图像。
handler will load the image from the imageid passed as a querystring to it. on handler we will right the code to read the image from database and display on the page.
这篇关于我们怎样才能创建SQL图片的灯箱画廊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!