在Windows照片查看器中打开图像
如何在C#app中打开Windows Photo Viewer中的.jpg
图像?
不像这段代码那样在app里面,
FileStream stream = new FileStream("test.png", FileMode.Open, FileAccess.Read); pictureBox1.Image = Image.FromStream(stream); stream.Close();
在新流程中启动它
Process photoViewer = new Process(); photoViewer.StartInfo.FileName = @"The photo viewer file path"; photoViewer.StartInfo.Arguments = @"Your image file path"; photoViewer.Start();
我想你可以使用:
Process.Start(@"C:\MyPicture.jpg");
这将使用与.jpg文件关联的标准文件查看器 – 默认情况下是Windows图片查看器。