怎样获取图像文件的大小啊? 怎样获取图像文件的大小啊?用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)该怎么写那 SWING BUTTON ICON FileTree的问题 jdbc连接到sql2005 怎么在本窗体添加一个按钮,通过单击按钮连接到from窗体! 16进制转换成整形的问题。 不懂了 一个简单的文件读取问题~~~~帮忙啊 JNA调用DLL--Struct里有个HWND不知道怎么转换 有谁知道那里有java编的支持MP3的播放器源代码(下载)? 几个基本概念问题,请高手指点? 如何把draw方法转换buffImage对象 问个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);
}
}