参考
http://www.java3z.com/cwbwebhome/article/article5a/571.htmlpublic int getPicWidthOrHeight(String photo, String flag) {
try {
File _file = new File(photo);
Image src = javax.imageio.ImageIO.read(_file);
int wideth = src.getWidth(null);
int height = src.getHeight(null);
if("W".equalsIgnoreCase(flag)){
return wideth;
}else{
return height;
}
} catch (Exception e) {
// TODO: handle exception
return 0;
}
}
获取图片宽高
3945

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



