gpt4 book ai didi

java - 使用 Windows 图片和传真查看器 (Java) 打开图像

转载 作者:行者123 更新时间:2023-11-29 06:21:14 25 4
gpt4 key购买 nike

我有一张图片,想用 Windows Picutre 和 Fax Viewer 打开。你是怎样做的?我可以用我知道 exe 文件的 mspaint 打开它。代码如下:

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

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

有谁知道Windows图片和传真查看器的exe文件吗?

最佳答案

我一直在寻找解决方案,并设法采用我在 C# 论坛上找到的解决方案。

Windows 图片和传真实际上是一个 .dll,而不是一个 .exe,这就是它不能立即可见的原因。使用线...

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

对我来说只是鸭子。 fileName 是 String 类型,以防它不明显。另外,对我来说,Windows 在驱动器 E 上,而不是 C 上。逃脱角色和所有其他有趣的小路障。希望这会有所帮助,抱歉我没有早点解决这个问题!

关于java - 使用 Windows 图片和传真查看器 (Java) 打开图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2950111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com