目的是装载图片,运行时抛出异常:
java.awt.image.RasterFormatException:( y + height ) is out of Raster代码如下:
public BufferedImage loadImage(){
   BufferedImage image = null;
   try{
      image = ImageIO.read(new File("d:/aa/aaa.jpg"));
   } catch ( Exception e ){
      System.out.println("装载图像错误!");
   }
   return image;
}请大虾帮忙

解决方案 »

  1.   

    image = ImageIO.read(new File("d:/aa/aaa.jpg"));
    这个你都能编译通过? 不用转换吗?
    把错误贴出来
      

  2.   

    image = ImageIO.read(new File("d:/aa/aaa.jpg"));
    这个你都能编译通过? 不用转换吗?
    把错误贴出来
      

  3.   

     image = ImageIO.read(new File("d:/aa/aaa.jpg"));
    这个你都能编译通过 ? 不用转换
    你把错误贴出来
      

  4.   

    要么文件不存在,要么该图片的色彩空间是adobe rgb的,别弄Exception异常,不然你根本不知道具体的异常是什么
      

  5.   

    这个你都能编译通过 ? 不用转换
        =》确实能编译通过
    你把错误贴出来
        =》运行时异常:java.awt.image.RasterFormatException:( y + height ) is out of Raster
    别弄Exception异常
        =》纯新手,不知道该用哪个异常:(
    要么文件不存在
        =》证实文件存在,下面的代码打印结果:true
             File file = new File("d:/aa/aaa.jpg");
             System.out.println(file.exists()); 
    要么该图片的色彩空间是adobe rgb的
        =》图片我是用Windows画板随便画的,色彩空间不清楚
      

  6.   

    这个你都能编译通过 ? 不用转换
        =》确实能编译通过
    你把错误贴出来
        =》运行时异常:java.awt.image.RasterFormatException:( y + height ) is out of Raster
    别弄Exception异常
        =》纯新手,不知道该用哪个异常:(
    要么文件不存在
        =》证实文件存在,下面的代码打印结果:true
             File file = new File("d:/aa/aaa.jpg");
             System.out.println(file.exists()); 
    要么该图片的色彩空间是adobe rgb的
        =》图片我是用Windows画板随便画的,色彩空间不清楚
      

  7.   

    这个你都能编译通过 ? 不用转换
        =》确实能编译通过
    你把错误贴出来
        =》运行时异常:java.awt.image.RasterFormatException:( y + height ) is out of Raster
    别弄Exception异常
        =》纯新手,不知道该用哪个异常:(
    要么文件不存在
        =》证实文件存在,下面的代码打印结果:true
             File file = new File("d:/aa/aaa.jpg");
             System.out.println(file.exists()); 
    要么该图片的色彩空间是adobe rgb的
        =》图片我是用Windows画板随便画的,色彩空间不清楚
      

  8.   

    这个你都能编译通过 ? 不用转换
        =》确实能编译通过
    你把错误贴出来
        =》运行时异常:java.awt.image.RasterFormatException:( y + height ) is out of Raster
    别弄Exception异常
        =》纯新手,不知道该用哪个异常:(
    要么文件不存在
        =》证实文件存在,下面的代码打印结果:true
             File file = new File("d:/aa/aaa.jpg");
             System.out.println(file.exists()); 
    要么该图片的色彩空间是adobe rgb的
        =》图片我是用Windows画板随便画的,色彩空间不清楚