I have a number in my database witch is 22, and means i have 22 images in one folder that i would like to create strings from ..
The other thing is that in each div tag i can ony have maximum 3 images, the first images gets the number 22(should be 1) while the two others gets 2 and 3(Witch is correct). I can only get 3 images to show and not all 22 in seperate divs
Code below:
if (CurrentPage["AntallBilderFlash"] != null) // CurrentPage["AntallBilderFlash"] is the number 22
{
int b = Convert.ToInt32(CurrentPage["AntallBilderFlash"]);
// int p = 1;
int i = 1;
int i1 = 2;
int i2 = 3;
string urler = "http://localhost/global/bilderflash/";
string name= "pic";
string slutt =".png";
do
{
Label1.Text = "

";
//i = i+3;
//this.Controls.Add(Label1);
i++;
} while (i < b);
}
thanks for helping me out if you can..
And yes my english is bad :)
CrishPosted Dec 2, 2010, 2:30 AM
I think this code will help you and if you want to understand it and get more detail about it than go for link.
http://www.daniweb.com/forums/thread226032.html
Example::
for file in files[:]:
image = Image.open(filedir+"/"+file)
##((width, height))
image.thumbnail((160, 240))
photo = ImageTk.PhotoImage(image)
label = Label(image=photo)
label.image = image # keep a reference!
label.pack()
print files
return