BufferedImage image1 = ImageIO.read(new File("照片路径"));
int width = image1.getWidth();
int height = image1.getHeight();
将目标文件的路径填进去就好了。
本文介绍了一种使用 Java 的 BufferedImage 类来获取本地文件中图片宽度和高度的方法。
int width = image1.getWidth();
int height = image1.getHeight();
将目标文件的路径填进去就好了。
1万+
3950
1056
1296

被折叠的 条评论
为什么被折叠?