How to display Bitmap Image in image control on WPF using C#

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2009-12-22T23:02:59Z Indexed on 2010/06/11 21:02 UTC
Read the original article Hit count: 261

Filed under:

I want that when I double click on a row in Listview, it should display the image corresponding to that row. This row also contains the path of the image.

I tried the following but it displays the same image for all rows because I have given the path for a specific image:

private void ListViewEmployeeDetails_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ImageSource imageSource = new BitmapImage(new Uri(@"C:\northwindimages\king.bmp")); image1.Source = imageSource; }

Please suggest

© Stack Overflow or respective owner

Related posts about wpf