怎样获取图像文件的大小啊? 怎样获取图像文件的大小啊?用JAVA类!望高手解决! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BufferedImage.getHeight();BufferedImage.getWidth(); BufferedImage image = ImageIO.read(new File(picturePath)); double imageWidth = image.getWidth(); double imageHeight = image.getHeight(); import java.io.File;import java.awt.image.BufferedImage;public class G{ public static void main(String[] args) throws Exception { File _file = new File("1.jpg"); //读入文件 BufferedImage src = javax.imageio.ImageIO.read(_file); //构造Image对象 int width = src.getWidth(null); //得到源图宽 int height = src.getHeight(null); //得到源图长 System.out.println("width="+width); System.out.println("height="+height); }} 如果要得到BufferedImage 的容量大小(kb)该怎么写那 SWT有没有编辑HTML的控件或开源的控件? 单例模式跟工厂模式的结合。。 java实现ADO.Net连接SQL数据库 求助 switch语句中的*号问题 没得分了.求高手指教,改天再开贴送兄弟分 java怎样格式化一个unix时间戳啊... 大家帮忙解决一下下面的问题,谢谢~~ 鼠标移动消息响应问题 打算学java ,请大家给推荐基本好书,最好有电子教程的 问个JSP短信平台的问题 我这个程序哪里有问题呢 大家帮忙 谢谢了
BufferedImage.getWidth();
double imageHeight = image.getHeight();
import java.awt.image.BufferedImage;public class G{ public static void main(String[] args) throws Exception {
File _file = new File("1.jpg"); //读入文件
BufferedImage src = javax.imageio.ImageIO.read(_file); //构造Image对象
int width = src.getWidth(null); //得到源图宽
int height = src.getHeight(null); //得到源图长
System.out.println("width="+width);
System.out.println("height="+height);
}
}