poi写入图片.docVIP

  • 71
  • 0
  • 约7.1千字
  • 约 6页
  • 2016-12-07 发布于河南
  • 举报
poi写入图片

POI实现Excel插入多张图片(转) POI的操作Excel时,不可避免有操作图片的处理。怎么插入图片呢?网上也有不少介绍。 下面的代码是向Excel中插入多张图片的例子: public static void main(String[] args) { FileOutputStream fileOut = null; BufferedImage bufferImg = null; BufferedImage bufferImg1 = null; try { // 先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray // 读入图片1 ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); bufferImg = ImageIO.read(new File(d:\\test11.jpg)); ImageIO.write(bufferImg, jpg, byteArrayOut);

文档评论(0)

1亿VIP精品文档

相关文档