0

When I try to open an image with the default picture viewer, it only loads the targeted image. Thats a problem, because its not possible to navigate/browse through the other images in the directory.

This is how I open the image:

Process.Start("explorer.exe", ImagePathString);

Maybe I need to start it directly with default viewer without the explorer handling it. But I don't how to parse it. I tried this, but it didn't work. I get a System.InvalidOperationException, because it cant find the right executable.

System.InvalidOperationException: 'Cannot start process because a file name has not been provided.'

Is there a way to load all Images from a directory or just enable the functions to navigate forwards and backwards?

Hossein Sabziani
  • 1
  • 2
  • 15
  • 20
SideSky
  • 313
  • 3
  • 15

1 Answers1

1

You must give the executable file of picture viewer as a FileName parameter to the process:

Process photoViewer = new Process();

//executable file of picture viewer
photoViewer.StartInfo.FileName = @"F:\Google.Picasa\Picasa3\Picasa3.exe";
photoViewer.StartInfo.Arguments =ImagePathString;
photoViewer.Start();
Hossein Sabziani
  • 1
  • 2
  • 15
  • 20
  • 1
    This helps a bit. Sadly you can't just target to the windows Photo viewer or other apps downloaded from the MS. It does work with Picasa – SideSky Nov 28 '22 at 11:47