我想将缓冲的图像保存在文件夹中然后检索它。但是当试图将其保存在文件夹中时,我收到错误“无法解析方法toBufferedImage(file)”
save(mapTraffic,"jpg", i); //here I call the method below
return captureSuccess;
} //this is from the previous method
private static void save(BufferedImage image, String ext, int i) {
File file = new File("mapSnapshot" + i + "." + ext);
image = toBufferedImage(file);
try {
image= ImageIO.write(image, ext, file);
} catch(IOException e) {
// System.out.println("Write error for " + file.getPath() +
// ": " + e.getMessage());
}
}
有人可以帮帮我,请问如何解决这个问题? 感谢