在程序中使用 ImageIO.read( )方法后,程序就停止不运行了,也没有报错。大神在哪儿!~~~求解决思路~~~代码如下:
File file = new File(filePath+File.separator+ fileName);
if(file.exists()){
ImageIO.read(file);//执行到此处,debug就停止了,不执行下一行
System.out.println(1);
}
File file = new File(filePath+File.separator+ fileName);
if(file.exists()){
ImageIO.read(file);//执行到此处,debug就停止了,不执行下一行
System.out.println(1);
}
解决方案 »
- shell调用java的问题:java如何获得shell的输入
- java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity
- transient | strictfp | volatile是什么意思???
- 请教请教关于finally的问题
- 寻找jdk1.1下载!!!
- 高分相送!!!Swing中如何才能一个JPanel面板容器绑定在一个滚动条组件上,使得JPanel里的内容可以在窗口改变大小的时候能出现滚动条
- $$$$$$高分求救!apache的设置文件httpd.conf的virtualhost参数如何配置?
- 书上的一个关于数据封装的例题,为何运行出错?请高手指点。
- 那位可以讲讲推拉技术的实现方法?
- 朋友们刚开始工作的时候,有没有上级让你读程序啊?可不可让我们这些刚入门的人以分享一下你的经验呢?谢谢了!!
- 下载的java源程序导入eclipse问题
- 用java求超大数最大公约数问题
在项目中已经用了try catch ,但没有报错,没抛出异常。
求 手动转换成bufferedimage的方法
* Convert the image to an buffered image.
* @param image An instance of the class Image
* @return An instance of the class BufferedImage that is converted from an image.
*/
public static BufferedImage imageToBufferedImage(Image image) {
int width = image.getWidth(null);
int height = image.getHeight(null); BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = buf.createGraphics();
g.drawImage(image, 0, 0, width, height, null);
g.dispose(); return buf;
}