开发者

Open Image with the Windows Picture and Fax Viewer (Java)

I have a picture which I would like to open with thewindows Picutre and Fax Viewer. How do you do that? I was able to open it with mspaint of which I know the exe File. The Code is the following:

        File imageFile = new File("filepath" + System.currentTimeMillis()+".png");
        ImageIO.write(printImg, "PNG", imageFile);

        String application = "mspaint.exe";
        Runtime.getRuntime().exec(application + " \"" + imageFile.getAbsolutePath()+"\"");

Does anybody know the exe of the Windows Picture 开发者_如何学编程and Fax Viewer?


I was looking for a solution to this and managed to adapt one I found on a C# forum.

Windows Picture and Fax is actually a .dll, not a .exe, which is why it isn't immediately visible. Using the line...

Runtime.getRuntime().exec("rundll32.exe E:\\WINDOWS\\System32\\shimgvw.dll,ImageView_Fullscreen "+filename);

worked just ducky for me. fileName is type String, in case it isn't obvious. Also, Windows is on drive E, not C, for me. Escape characters and all those other fun little roadbumps. Hope this helps, and sorry I didn't get to this problem earlier!


I'm not sure but when I open up task manager and select "Go to Process" on the Windows Picture and Fax Viewer..it says that it runs under the explorer.exe process.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜