Show photos in silverlight
//// .xaml
//// .xaml.cs
private void btn1_Click(object sender, RoutedEventArgs e)
{
show.Children.Add(displayalbums());
}
public Canvas displayalbums()
{
show.Children.Clear();
Image img; int j = 0; double k = 1; int i;
Canvas c = new Canvas();
c.SetValue(Canvas.LeftProperty, 20.0);
for (i = 0; i < img =" new" height =" 100;" width =" 110;" src =" new" imgsource =" new" source =" imgSource;"> 3)
{ j = 0; k += 180.0; }
}
show.SetValue(Canvas.HeightProperty,(pagecounter(25))*180.0);
return c;
}
public int pagecounter(int n)
{
int i, r;
r = n % 4; // (4) denotes no. of items in each line
i = n / 4;
if (r > 0)
{ n = i + 1; }
else
{ n = i; }
return n;
}
Note: Make sure that your client bin directory contains the older 'images' and
all the images in that directory
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home