Open image from PictureBox in Windows Photo Viewer c#

  • Last Post 04 September 2018
  • Topic Is Solved
Stylus STYLUS posted this 04 September 2018

I find this solution

I have picture saved in database and retrieved from database in picture box...that working fine.

I need to show that picture in picture and fax viewer

Error is : The system can't find file specified

Some help?

private void button12_Click(object sender, EventArgs e)
            Process photoViewer = new Process();
            photoViewer.StartInfo.FileName = @"c:\\testImage.jpg";
            photoViewer.StartInfo.Arguments = @"c:\\testImage.jpg";
Order By: Standard | Newest | Votes
Stylus STYLUS posted this 04 September 2018

This solution is ok, how to define PathOfFile?


Process.Start("C:\windows\system32\rundll32.exe", "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & PathOfFile);
Stylus STYLUS posted this 04 September 2018


string myPictures = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
string myPath = System.IO.Path.Combine(myPictures, "testImage.jpg");

dataPictureBox.Image.Save(myPath, System.Drawing.Imaging.ImageFormat.Jpeg);

// Use default image viewer

// Use image viewer application indicated by the variable "myImageViewer"
//System.Diagnostics.Process.Start(myImageViewer, myPath);
Daniel Soares posted this 04 September 2018

When using @ before string declarations, the double bars (\\) are not needed anymore, just one (\).