java获取图片的宽度高度

import javax.swing.ImageIcon;
String path = getImagePath(request);
ImageIcon   icon=new         ImageIcon(  request.getRealPath("/images/"+path));
int   iWidth=icon.getIconWidth();
int   iHeight=icon.getIconHeight();
}

你可能感兴趣的:(java获取图片的宽度高度)