关于向 Java ImageWriter 添加插件的帮助
我正在尝试将 BufferedImage 保存为 PNM 文件。我已经安装了 JAI(Java Advanced Imaging),并导入了 PNMWriter 插件。但是,我不知道如何将其添加到我的 ImageWriter 中,以便它可以以 .pnm 格式写入。当我运行 ImageIO.getWriterFormatNames() 来获取可能的格式名称时,只出现标准格式名称(.png、.bmp、.jpg...)...
I am trying to save a BufferedImage as a PNM file. I already installed the JAI (Java Advanced Imaging), and have the PNMWriter plug-in imported. However, I don't know how to add it to my ImageWriter so it can write in .pnm. When I run ImageIO.getWriterFormatNames() to get the possible format names, only the standard ones (.png, .bmp, .jpg....) come up... What do
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己为我的软件实现了这个。它只有 30 行源代码,我不想添加 Java Advanced Imaging 来解决如此容易解决的问题。这是我的解决方案:
I implemented this myself for my software. It was only 30 lines of source code and I did not want to add Java Advanced Imaging for something that can be solved so easily. Here is my solution:
使用 JAI(
JAI
类),而不是ImageIO
(Java 标准),使用:Use JAI (
JAI
class), notImageIO
(Java standard), use: