Resolved process.start more image

Andy75

Member
Joined
May 29, 2020
Messages
18
Programming Experience
1-3
Hi all,
I have a string variable (path) that i get from an openFileDialog (Windows 10).
I would like to pass this path to Process.Start to start browsing the images of a folder.
I would like to show "next" and "previous" buttons too, in this way the user can moves with the mouse arrows.
How is this possible?
I have tried with
"ProcessStartInfo startInfo = new ProcessStartInfo (fileImage)",
but the button next and previuos are not there.
Tips?

thanks
 
Unfortunately that is not going to work. When you call Process.Start() giving it just a filename the default image viewer is launched by Windows and you don't have any control over that viewer that is launched. That viewer may not be the Win10 Photo Viewer. It may be Adobe. It may ACDSee. It may be plain old MSPaint.exe.

To get what you want where you have control, you'll need to create a form with the next/previous buttons and a picture box. Just load the "current" image into the picture box, and act appropriately when the next and previous buttons are pressed.
 
He's talking about the MS Photos app, when opening an image file from Explorer you can browse previous/next in same folder, but with Process.Start the app is locked to only that file. I've tried several ways to open that app with image file path and no luck in making it behave like it does with normal Explorer interaction.
 
You can do this :
C#:
            const string Location_ToOpen = @"C:\Users\user\Downloads\Imported Pics\102ND500\Canapy Shots\Me In Canopy\Copyright\SCP_3546.jpg";
            ProcessStartInfo Process_Info = new ProcessStartInfo(Location_ToOpen, @"%SystemRoot%\System32\rundll32.exe % ProgramFiles %\Windows Photo Viewer\PhotoViewer.dll, ImageView_Fullscreen %1")
            {
                UseShellExecute = true,
                WorkingDirectory = Path.GetDirectoryName(Location_ToOpen),
                FileName = Location_ToOpen,
                Verb = "OPEN"
            };
            Process.Start(Process_Info);
Tested and working. Hope it helps.
 
Doesn't work for me, no previous/next.
 
Yes W10 same as OP. He also said that it did work before in W7.
 
That's not the issue, as explained previously in thread.
 
He's talking about the MS Photos app, when opening an image file from Explorer you can browse previous/next in same folder, but with Process.Start the app is locked to only that file. I've tried several ways to open that app with image file path and no luck in making it behave like it does with normal Explorer interaction.
 
I would like to pass this path to Process.Start to start browsing the images of a folder.
What he asked for is what I presented, and the code I gave does that by using the Photos Previewer application. Well, it's actually a DLL, but whatever.

Can you provide me a screenshot of what you are referring to, encase I think its something its not.
 
1590884645674.png


No such navigation when opening the file with Process.
 
Even at max zoom I can't tell what app is in the screenshot. But It's not the one I provided a code solution for. However, it will do as he asked. Just not with whatever app that is that you've screenshot.
 
Back
Top Bottom