【发布时间】:2016-01-18 07:15:21
【问题描述】:
我正在尝试使用 java 从 postgresql 中的数据库中获取图像,我想知道如何为该图像创建命名路由(例如 C:/images/pic.png),这就是我采取的方式图片来自数据库。
InputStream is;
ImageIcon foto;
is = results.getBinaryStream(i+1);
BufferedImage bi = ImageIO.read(is);
foto = new ImageIcon(bi);
Image img = foto.getImage();
Image newimg = img.getScaledInstance(140, 170, java.awt.Image.SCALE_SMOOTH);
ImageIcon newicon = new ImageIcon(newimg);
谢谢。
【问题讨论】:
标签: java image postgresql inputstream imageicon