在我的C#应用程序中,我想启动默认图像编辑器来编辑图像。
当我使用System.Diagnostics.Process.Start("C:\image.png")它将使用Windows照片查看器打开图像文件。
当我右键单击Windows资源pipe理器中的图像文件时,会出现一个“编辑”菜单项,启动Microsoft画图(默认情况下)。 我想在我的应用程序中做同样的事情(即使用默认的图像编辑器打开文件)。
我不想通过执行Process.Start("mspaint.exe C:\image.png")对MS Paint进行硬编码。 我宁愿使用由用户设置的默认图像编辑器程序(可能不同于MS Paint)。
WinProcEvent一个或多个SetWinEventHookcallback?
C#Windows服务 – 多个定时器
X509Store位置与商店?
带宽整形和虚拟networking层/界面 – Windows + .NET
任何方式立即触发WaitOne()的超时?
有没有办法做到这一点?
谢谢弗兰克
在Windows启动时启动wpf应用程序
如何以编程方式设置软件限制策略
检查两个NTAccount对象的相等性
是否有可能在VB.net中包含两个具有相同名称的DLL库?
从Windows移植到Mac
你可以试着用动词edit来开始一个过程。
processstartinfo startInfo = new processstartinfo("C:\image.png"); startInfo.Verb="edit"; Process.Start(startInfo);
如果你想通过一个默认的WinDows编辑器在pictureBox中打开你的图像,试试这个;
//Create temporary file name String TMP_IMAGE = "tempImage" +DateTime.Now.Millisecond +".bmp"; //get the folder of application string PATH_APP = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"tempImage"; //Create a subFolder tempImage Directory.CreateDirectory(PATH_APP); //Save a new path in a variable String NEW_PATH = PATH_APP + TMP_IMAGE; //Save the image in the pictureBox in the new path and file name pictureBox.Image.Save(NEW_PATH); //Lunch the process with defaoul image editor in the comouter processstartinfo startInfo = new processstartinfo(NEW_PATH); Process.Start(startInfo);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。