这是我现在拥有的代码:
File file= new File("C:\Documents and Settings\vasanth\Desktop\s.PNG");
BufferedImage image;
try {
image = ImageIO.read(file);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Raster raster = image.getRaster();
BufferedImage image2 = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
WritableRaster raster2 = image2.getRaster();
BufferedImage image3 = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
WritableRaster raster3 = image3.getRaster();
我应该保留我在这里使用的图像吗?即使我已经指定了图像文件的完整路径,我仍然会收到错误消息。