Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display many images one by one using image control in wpf.

This is my code.
Please let me know how to proceed.

var imgname = Class1.name;


var images = (from pd in SvarkWindow.prodlist where pd.Product_name.StartsWith(imgname) select pd.Image).ToList();

BitmapImage b = new BitmapImage();
b.BeginInit();

//b.UriSource = new Uri(images.ElementAtOrDefault(0), UriKind.Relative);
b.UriSource = new Uri("http://portal.liftech.in/presc/" + images.ElementAtOrDefault(0));

b.EndInit();

// ... Get Image reference from sender.
Image img1 = Productimage0 as Image;

//var image = image1 as Image;
// ... Assign Source.

img1.Source = b;
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900