Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open image in Windows Photo Viewer

Tags:

c#

image

winforms

How to open .jpg image in Windows Photo Viewer from C# app?

Not inside app like this code,

FileStream stream = new FileStream("test.png", FileMode.Open, FileAccess.Read); pictureBox1.Image = Image.FromStream(stream); stream.Close(); 
like image 992
Beliszz Avatar asked Jul 24 '11 16:07

Beliszz


People also ask

How do I open Photos in Windows Photo Viewer?

Assuming you upgraded to Windows 10 from a previous version of Windows, you should see Windows Photo Viewer as an option. Choose Windows Photo Viewer and exit the Settings menu, and you're done -- photos will now open up in Windows Photo Viewer.

How do I open a JPEG in Windows Photo Viewer?

Method 1: Set Windows Photo Viewer as Your Default Viewer To open any image file format with Windows Photo Viewer, right-click on any image file type, such as . bmp, . gif, . jpg, or .

How do I view Photos on Windows 10?

The Photos app in Windows 10 gathers photos from your PC, phone, and other devices, and puts them in one place where you can more easily find what you're looking for. To get started, in the search box on the taskbar, type photos and then select the Photos app from the results. Or, press Open the Photos app in Windows.


2 Answers

I think you can just use:

Process.Start(@"C:\MyPicture.jpg"); 

And this will use the standard file viewer associated with .jpg files - by default the windows picture viewer.

like image 195
iandotkelly Avatar answered Sep 29 '22 03:09

iandotkelly


Start it in a new Process

Process photoViewer = new Process(); photoViewer.StartInfo.FileName = @"The photo viewer file path"; photoViewer.StartInfo.Arguments = @"Your image file path"; photoViewer.Start(); 
like image 29
Jalal Said Avatar answered Sep 29 '22 03:09

Jalal Said