怎样获取图像文件的大小啊?用JAVA类!
望高手解决!

解决方案 »

  1.   

    BufferedImage.getHeight();
    BufferedImage.getWidth();
      

  2.   

    BufferedImage image = ImageIO.read(new File(picturePath)); double imageWidth = image.getWidth();
    double imageHeight = image.getHeight();
      

  3.   

    import java.io.File;
    import java.awt.image.BufferedImage;public class G{ public static void main(String[] args) throws Exception {
    File _file = new File("1.jpg"); //读入文件
    BufferedImage src = javax.imageio.ImageIO.read(_file); //构造Image对象
    int width = src.getWidth(null); //得到源图宽
    int height = src.getHeight(null); //得到源图长
    System.out.println("width="+width);
    System.out.println("height="+height);
    }
    }
      

  4.   

    如果要得到BufferedImage 的容量大小(kb)该怎么写那