62,621
社区成员
发帖
与我相关
我的任务
分享File file = new File(filePath+File.separator+ fileName);
if(file.exists()){
ImageIO.read(file);//执行到此处,debug就停止了,不执行下一行
System.out.println(1);
} /**
* Convert the image to an buffered image.
* @param image An instance of the class Image
* @return An instance of the class BufferedImage that is converted from an image.
*/
public static BufferedImage imageToBufferedImage(Image image) {
int width = image.getWidth(null);
int height = image.getHeight(null);
BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = buf.createGraphics();
g.drawImage(image, 0, 0, width, height, null);
g.dispose();
return buf;
}