please use image.getWidth and image.getHeight() directly!

解决方案 »

  1.   

    我要得到的图片大小的情况是这样的,首先从服务器端读出图片文件,然后得到图片的大小,只用Image类是不够的
      

  2.   

    ImageIcon ii = new ImageIcon("C:/file.gif");
    ii.getHeight();
    ii.getWidth();
      

  3.   

    File iFile = readFromServer();//..
    ImageIcon aImage = new ImageIcon(iFile.getPath());
    int height = aImage.getHeight();
    int width = aImage.getWidth();