java中使用ImageIo获取图片信息


 File imgFile = new File("D:\\a.jpg");
        InputStream is = null;
        BufferedImage src = null;
        int wid = -1;
        int hig = -1;
        is = new FileInputStream(imgFile);
        src = ImageIO.read(is);
        wid = src.getWidth(); // 得到源图宽
        hig = src.getHeight();
                   src.****();

你可能感兴趣的:(java)