wilkersons
asked on
Slideshow using VB.NET & ASP.NET
Guys,
I am new to ASP.NET & VB.NET. I have a question with regards to slideshows. How can the contents of a folder be dynamically displayed as thumbnails on a website?
Thanks in advance
I am new to ASP.NET & VB.NET. I have a question with regards to slideshows. How can the contents of a folder be dynamically displayed as thumbnails on a website?
Thanks in advance
There's an article to show you how to read images from a directory & display them in a slideshow here : http://aspnet.4guysfromrolla.com/articles/070704-1.aspx
Hope that helps ...
Hope that helps ...
ASKER
Gitcho,,
thanks. But some how i am not able to run these programs ...i need to do some reading about the above mentioned programs..
will get back soon
thanks. But some how i am not able to run these programs ...i need to do some reading about the above mentioned programs..
will get back soon
Const IMAGE_DIRECTORY As String = "images/"
Dim pics() As String
Dim s As String, html As String
Dim i As Integer
Dim objFile As IO.FileInfo
pics = IO.Directory.GetFiles(IMAG E_DIRECTOR Y)
For i = 0 To pics.Length - 1
objFile = New IO.FileInfo(pics(i))
Next
dlPictures.DataSource = pics
dlPictures.DataBind()
Dim pics() As String
Dim s As String, html As String
Dim i As Integer
Dim objFile As IO.FileInfo
pics = IO.Directory.GetFiles(IMAG
For i = 0 To pics.Length - 1
objFile = New IO.FileInfo(pics(i))
Next
dlPictures.DataSource = pics
dlPictures.DataBind()
ASKER
YZlat can you pl explain the code. How do I use this code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wilkersons the above code is perfect for what you are trying to accomplish, when you get familiar with this code and you prefer to give it some more dynamic look generate page like his: http://www.frozendev.com/temp/image.asp
all you have to do is give image array proper definition (image source, x-position, y-position, width and height.)
I'm sure it will look more decent then example on 4guysfromrolla...
images[0]=[];
(animate)?images[0][0]=new Image():images[0][0]=[];
(animate)?images[0][0].src ="0.gif":i mages[0][0 ]="0.gif";
(animate)?images[0][1]=new Image():images[0][1]=[];
(animate)?images[0][1].src ="1.gif":i mages[0][1 ]="1.gif";
(animate)?images[0][2]=new Image():images[0][2]=[];
(animate)?images[0][2].src ="2.gif":i mages[0][2 ]="2.gif";
(animate)?images[0][3]=new Image():images[0][0]=[];
(animate)?images[0][3].src ="3.gif":i mages[0][0 ]="3.gif";
(animate)?images[0][4]=new Image():images[0][1]=[];
(animate)?images[0][4].src ="4.gif":i mages[0][1 ]="4.gif";
(animate)?images[0][5]=new Image():images[0][2]=[];
(animate)?images[0][5].src ="5.gif":i mages[0][2 ]="5.gif";
(animate)?images[0][6]=new Image():images[0][6]=[];
(animate)?images[0][6].src ="6.gif":i mages[0][6 ]="6.gif";
(animate)?images[0][7]=new Image():images[0][7]=[];
(animate)?images[0][7].src ="7.gif":i mages[0][7 ]="7.gif";
(animate)?images[0][8]=new Image():images[0][8]=[];
(animate)?images[0][8].src ="8.gif":i mages[0][8 ]="8.gif";
(animate)?images[0][9]=new Image():images[0][9]=[];
(animate)?images[0][9].src ="10.gif": images[0][ 9]="10.gif ";
(animate)?images[0][10]=ne w Image():images[0][10]=[];
(animate)?images[0][10].sr c="11.gif" :images[0] [10]="11.g if";
images[1]=0; // x
images[2]=0; // y
images[3]=200; // w
images[4]=150; // h
images[5]="img1"; // name
images[6]=0; // sequence
the full example of this source code is availabe from that path I posted above this sectiom...
cheers!
dave
all you have to do is give image array proper definition (image source, x-position, y-position, width and height.)
I'm sure it will look more decent then example on 4guysfromrolla...
images[0]=[];
(animate)?images[0][0]=new
(animate)?images[0][0].src
(animate)?images[0][1]=new
(animate)?images[0][1].src
(animate)?images[0][2]=new
(animate)?images[0][2].src
(animate)?images[0][3]=new
(animate)?images[0][3].src
(animate)?images[0][4]=new
(animate)?images[0][4].src
(animate)?images[0][5]=new
(animate)?images[0][5].src
(animate)?images[0][6]=new
(animate)?images[0][6].src
(animate)?images[0][7]=new
(animate)?images[0][7].src
(animate)?images[0][8]=new
(animate)?images[0][8].src
(animate)?images[0][9]=new
(animate)?images[0][9].src
(animate)?images[0][10]=ne
(animate)?images[0][10].sr
images[1]=0; // x
images[2]=0; // y
images[3]=200; // w
images[4]=150; // h
images[5]="img1"; // name
images[6]=0; // sequence
the full example of this source code is availabe from that path I posted above this sectiom...
cheers!
dave
wlkersons:
''declare your directory(where images are stored)
Const IMAGE_DIRECTORY As String = "images/"
''declare an array of strings
Dim pics() As String
Dim s As String, html As String
Dim i As Integer
Dim objFile As IO.FileInfo
''fill an array of strings with image file names
pics = IO.Directory.GetFiles(IMAG E_DIRECTOR Y)
''loop through the data in a array and read it into file object
For i = 0 To pics.Length - 1
objFile = New IO.FileInfo(pics(i))
Next
dlPictures.DataSource = pics
dlPictures.DataBind()
''declare your directory(where images are stored)
Const IMAGE_DIRECTORY As String = "images/"
''declare an array of strings
Dim pics() As String
Dim s As String, html As String
Dim i As Integer
Dim objFile As IO.FileInfo
''fill an array of strings with image file names
pics = IO.Directory.GetFiles(IMAG
''loop through the data in a array and read it into file object
For i = 0 To pics.Length - 1
objFile = New IO.FileInfo(pics(i))
Next
dlPictures.DataSource = pics
dlPictures.DataBind()
YZat, zdarova zemliak vi gde jiviote..?
ASKER
Thanks guys for all your answers. Got it working. I will give this one to Gitcho.
If you have your all your thumbnails in the same folder, you can read them from the directory into an array, and output them on your page.
If you need to dynamically resize images to thumbnails, here's a good article on it here : http://aspnet.4guysfromrolla.com/articles/081303-1.aspx