1,获取本地图片大小(尺寸)
File picture=new File(strSrc);
BufferedImage sourceImg=ImageIO.read(new
FileInputStream(picture));
sourceImg.getWidth();
sourceImg.getHeight();
2,获取网络图片大小(尺寸)
BufferedImage sourceImg=ImageIO.read(new URL(strSrc).openStream());
sourceImg.getWidth();
sourceImg.getHeight();
-------------------------------------------------
java 获取图片大小(尺寸)
时间: 2024-12-22 04:12:27