wpfimage

How to open images on default image viewer in WPF


I am binding my images which are coming from server in the listview .These images are bitmap images. When I click on any of the image from the listview I want it to open in the default Image-Viewer on Windows. Any way to achieve this ?


Solution

  • If there is a default viewer, there should be an association for the extension of the file. As a result, you can just shell-start the file. Use Process.Start like,

    System.Diagnostics.Process.Start("imagePath");