I need to display the images from remote database.here I have a code to display images from local file.But I can't get it from remote server
C#
code
DispatcherTimer timer = new DispatcherTimer();
List<string> files = new List<string>() { "http://technomindtech.com/1tele-pixel.com/ad/banner.jpg", "http://technomindtech.com/1tele-pixel.com/ad/logo_banner.jpg", "http://technomindtech.com/1tele-pixel.com/ad/images.jpeg" };
List<BitmapImage> images = new List<BitmapImage>();
int current = 0;
foreach (string file in files)
{
BitmapImage image = new BitmapImage(new Uri(file, UriKind.Relative));
images.Add(image);
}
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(3);
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
void timer_Tick(object sender, EventArgs e)
{
Image1.Source = images[current];
current++;
if (current >= files.Count)
current = 0;
}
Xaml
code
<Image x:Name="Image1" Stretch="Fill" Width="410" Grid.ColumnSpan="3" Margin="-8,0,-29,0" />
but it throws Uri exception it can't show the image